| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
llvm-svn: 222306
|
|
|
|
|
|
|
| |
This eliminates converting back and forth between the 3 formats and
gives us a more homogeneous interface.
llvm-svn: 220657
|
|
|
|
|
|
| |
const from some other StringRefs since its implicitly const already.
llvm-svn: 216825
|
|
|
|
| |
llvm-svn: 216715
|
|
|
|
| |
llvm-svn: 216585
|
|
|
|
| |
llvm-svn: 216476
|
|
|
|
| |
llvm-svn: 215926
|
|
|
|
|
|
| |
The facility was abstracted to LLVM in r187364.
llvm-svn: 212441
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes a const_cast added in r211884 that occurred due to an
inconsistency in how MemoryBuffers are handled between some parts of
clang and LLVM.
MemoryBuffers are immutable and the general convention in the LLVM
project is to omit const from immutable types as it's simply
redundant/verbose (see llvm::Type, for example). While this change
doesn't remove "const" from /every/ MemoryBuffer, it at least makes this
chain of ownership/usage consistent.
llvm-svn: 211915
|
|
|
|
| |
llvm-svn: 208280
|
|
|
|
|
|
|
|
|
| |
alignment constraint rather than using the allocator function's over
alignment "feature". This was the only use of the "feature" which I plan
to remove next. =] Attaching the alignment to the type seems cleaner and
more principled anyways.
llvm-svn: 206324
|
|
|
|
|
|
| |
Found by -Wunreachable-code.
llvm-svn: 203167
|
|
|
|
| |
llvm-svn: 202639
|
|
|
|
| |
llvm-svn: 201739
|
|
|
|
| |
llvm-svn: 195563
|
|
|
|
| |
llvm-svn: 195024
|
|
|
|
|
|
|
|
|
| |
- We really shouldn't compute line numbers for every file that is asked if it's
the main file, it destroys the lazy computation.
- Invalid locations are no longer accounted to the main file, no other
functionality change.
llvm-svn: 191535
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: rsmith
Reviewed By: rsmith
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1183
llvm-svn: 187386
|
|
|
|
| |
llvm-svn: 187379
|
|
|
|
| |
llvm-svn: 187367
|
|
|
|
|
|
|
|
| |
callees of SourceManager::getSLocEntryByID().
Also add an 'Invalid' check in SourceManager::computeMacroArgsCache().
llvm-svn: 183538
|
|
|
|
|
|
| |
valid FileID (V2).
llvm-svn: 182698
|
|
|
|
|
|
|
|
| |
valid FileID.
Suggested by Jordan.
llvm-svn: 182695
|
|
|
|
|
|
| |
This is to address crash in rdar://13932308
llvm-svn: 182681
|
|
|
|
| |
llvm-svn: 182675
|
|
|
|
|
|
|
|
| |
function macro arguments.
This is a modified version of a patch by Manuel Klimek.
llvm-svn: 182055
|
|
|
|
|
|
|
|
|
| |
"included/expanded in" decomposed location of the given FileID.
The main benefit is to speed-up SourceManager::isBeforeInTranslationUnit which is common to query
the included/expanded location of the same FileID multiple times.
llvm-svn: 179435
|
|
|
|
| |
llvm-svn: 176333
|
|
|
|
|
|
|
|
| |
don't enter an infinite loop.
rdar://13120919
llvm-svn: 176331
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
isBeforeInTranslationUnit() uses a cache to reduce the expensive work
to compute a common ancestor for two FileIDs. This work is very
expensive, so even caching the latest used FileIDs was a big win.
A closer analysis of the cache before, however, shows that the cache
access pattern would oscillate between a working set of FileIDs, and
thus caching more pairs would be profitable.
This patch adds a side table for extending caching. This side table
is bounded in size (experimentally determined in this case from
a simple Objective-C project), and when the table gets too large
we fall back to the single entry caching before as before.
On Sketch (a small example Objective-C project), this optimization
reduces -fsyntax-only time on SKTGraphicView.m by 5%. This is
for a project that is already using PCH.
Fixes <rdar://problem/13299847>
llvm-svn: 176142
|
|
|
|
|
|
|
|
| |
This may seem counter-intuitive but the POD-like optimization helps when the
vectors grow into multimegabyte buffers. SmallVector calls realloc which knows
how to twiddle virtual memory bits and avoids large copies.
llvm-svn: 175906
|
|
|
|
| |
llvm-svn: 175705
|
|
|
|
|
|
| |
Post-commit CR feedback from Jordan Rose regarding r175594.
llvm-svn: 175679
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, -Wunused-comparison ignored comparisons in both macro bodies and
macro arguments, but we would still emit a -Wunused-value warning for either.
Now we correctly emit -Wunused-comparison for expressions in macro arguments.
Also, add isMacroBodyExpansion to SourceManager, to go along with
isMacroArgExpansion.
llvm-svn: 172279
|
|
|
|
|
|
| |
end of the cache. Fixes PR14570.
llvm-svn: 170281
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
uncovered.
This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.
I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.
llvm-svn: 169237
|
|
|
|
|
|
|
|
|
| |
working with preprocessed testcases. This causes source locations in
diagnostics to point at the spelling location instead of the presumed location,
while still keeping the semantic effects of the line directives (entering and
leaving system-header mode, primarily).
llvm-svn: 168004
|
|
|
|
|
|
|
|
|
|
| |
macro expansion ranges, make sure to check all the FileID
entries that are contained in the spelling range of the
expansion for the macro argument.
Fixes rdar://12537982
llvm-svn: 166359
|
|
|
|
|
|
| |
its on the same line as the last call to getLineNumber. Prevents needing to scan backwards for the new line. Fixes PR14106.
llvm-svn: 166265
|
|
|
|
|
|
|
| |
add more code that references SourceFile, so removing the dead store
doesn't seem appropriate for the long term.
llvm-svn: 165837
|
|
|
|
| |
llvm-svn: 163325
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
as "volatile", meaning there's a high enough chance that they may
change while we are trying to use them.
This flag is only enabled by libclang.
Currently "volatile" source files will be stat'ed immediately
before opening them, because the file size stat info
may not be accurate since when we got it (e.g. from the PCH).
This avoids crashes when trying to reference mmap'ed memory
from a file whose size is not what we expect.
Note that there's still a window for a racing issue to occur
but the window for it should be way smaller than before.
We can consider later on to avoid mmap completely on such files.
rdar://11612916
llvm-svn: 160074
|
|
|
|
| |
llvm-svn: 159628
|
|
|
|
|
|
|
|
|
|
| |
r158085 added some logic to track predefined declarations. The main reason we
had predefined declarations in the input was because the __builtin_va_list
declarations were injected into the preprocessor input. As of r158592 we
explicitly build the __builtin_va_list declarations. Therefore the predefined
decl tracking is no longer needed.
llvm-svn: 158732
|
|
|
|
|
|
|
| |
It turns out SourceManager treating the "one-past-the-end" location as invalid,
but then failing to set the invalid flag properly.
llvm-svn: 158699
|
|
|
|
| |
llvm-svn: 158614
|
|
|
|
| |
llvm-svn: 158549
|
|
|
|
|
|
| |
from Tom Honermann!
llvm-svn: 158211
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In standard C since C89, a 'translation-unit' is syntactically defined to have
at least one "external-declaration", which is either a decl or a function
definition. In Clang the latter gives us a declaration as well.
The tricky bit about this warning is that our predefines can contain external
declarations (__builtin_va_list and the 128-bit integer types). Therefore our
AST parser now makes sure we have at least one declaration that doesn't come
from the predefines buffer.
Also, remove bogus warning about empty source files. This doesn't catch source
files that only contain comments, and never fired anyway because of our
predefines.
PR12665 and <rdar://problem/9165548>
llvm-svn: 158085
|
|
|
|
|
|
|
|
|
|
|
| |
validate that we didn't override the contents of any of such files.
If this is detected, emit a diagnostic error and recover gracefully
by using the contents of the original file that the PCH was built from.
Part of rdar://11305263
llvm-svn: 156107
|