| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state.
Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect
a lot of places, like C++ inline methods, template instantiations, the lexer, etc.
Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location.
Fixes rdar://8365684.
llvm-svn: 121873
|
|
|
|
|
|
|
| |
better to actually produce a decent set of completions by checking the
system include paths, but not today. Fixes PR8744.
llvm-svn: 121431
|
|
|
|
|
|
|
|
|
|
|
| |
than a Token that holds the same information all in one easy-to-use
package. There's no technical reason to prefer the former -- the
information comes from a Token originally -- and it's clumsier to use,
so I've changed the code to use tokens everywhere.
Approved by clattner
llvm-svn: 119845
|
|
|
|
|
|
|
| |
SourceManager::getPresumedLoc(), so that we don't try to make use of
an invalid presumed location. Doing so can cause crashes.
llvm-svn: 118885
|
|
|
|
|
|
|
|
|
|
|
| |
The callback info for #if/#elif is not great -- ideally it would give
us a list of tokens in the #if, or even better, a little parse tree.
But that's a lot more work. Instead, clients can retokenize using
Lexer::LexFromRawLexer().
Reviewed by nlewycky.
llvm-svn: 118318
|
|
|
|
|
|
|
|
|
| |
inclusion directives, keeping track of every #include, #import,
etc. in the translation unit. We keep track of the source location and
kind of the inclusion, how the file name was spelled, and the
underlying file to which the inclusion resolved.
llvm-svn: 116952
|
|
|
|
|
|
|
|
|
| |
Now MICache is a linked list (per the FIXME), where we tradeoff between MacroInfo objects being in MICache
and MIChainHead. MacroInfo objects in the MICache chain are already "Destroy()'ed", so they can be reused. When
inserting into MICache, we need to remove them from the regular linked list so that they aren't destroyed more than
once.
llvm-svn: 116869
|
|
|
|
|
|
| |
Preprocessor.
llvm-svn: 116864
|
|
|
|
|
|
|
|
|
| |
The problem was not the management of MacroInfo objects, but that when we recycle them
via the MICache the memory of the underlying SmallVector (within MacroInfo) was not getting
released. This is because objects stashed into MICache simply are reused with a placement
new, and never have their destructor called.
llvm-svn: 116862
|
|
|
|
|
|
|
|
|
|
|
|
| |
the Preprocessor maintain them in a linked
list of allocated MacroInfos. This requires only 1 extra pointer per MacroInfo object, and allows us to blow them
away in one place. This fixes an elusive memory leak with MacroInfos (whose exact location I couldn't still figure
out despite substantial digging).
Fixes <rdar://problem/8361834>.
llvm-svn: 116842
|
|
|
|
|
|
|
|
| |
spelled (#pragma, _Pragma, __pragma). In -E mode, use that information
to add appropriate newlines when translating _Pragma and __pragma into
#pragma, like GCC does. Fixes <rdar://problem/8412013>.
llvm-svn: 113553
|
|
|
|
|
|
|
| |
e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname>
expression in a preprocessor conditional.
llvm-svn: 111954
|
|
|
|
|
|
| |
e.g., after a "#" we'll suggest #if, #ifdef, etc.
llvm-svn: 111943
|
|
|
|
| |
llvm-svn: 111768
|
|
|
|
| |
llvm-svn: 111364
|
|
|
|
| |
llvm-svn: 111234
|
|
|
|
|
|
| |
"unterminated string" when we're performing code completion.
llvm-svn: 110933
|
|
|
|
| |
llvm-svn: 110544
|
|
|
|
|
|
| |
#undefs in -dD mode. (PR7818)
llvm-svn: 110523
|
|
|
|
|
|
| |
Fixes PR4897.
llvm-svn: 110440
|
|
|
|
|
|
|
|
| |
into ContentCache::getBuffer. This allows it to produce
diagnostics on the broken #include line instead of without a
location.
llvm-svn: 101939
|
|
|
|
|
|
| |
Zhanyong Wan!
llvm-svn: 101813
|
|
|
|
| |
llvm-svn: 101226
|
|
|
|
|
|
| |
the C-only "optimization".
llvm-svn: 100022
|
|
|
|
| |
llvm-svn: 100018
|
|
|
|
|
|
|
| |
term "fix-it" everywhere and even *I* get tired of long names
sometimes. No functionality change.
llvm-svn: 100008
|
|
|
|
|
|
| |
recovery for those that need it.
llvm-svn: 98689
|
|
|
|
|
|
| |
them to recover more gracefully on failure.
llvm-svn: 98672
|
|
|
|
| |
llvm-svn: 98436
|
|
|
|
|
|
| |
returns a StringRef. Use it to simplify some repetitive code.
llvm-svn: 97322
|
|
|
|
|
|
|
|
| |
guard macro is already defined for the first occurrence of the
header. If it is, the body will be skipped and not be properly
analyzed for the include guard optimization.
llvm-svn: 95972
|
|
|
|
|
|
|
| |
is #included with "foo.h" style syntax instead of framework syntax.
It produced too much noise.
llvm-svn: 94120
|
|
|
|
|
|
|
| |
pointer is always non-null because the PTH case exits earlier
in the method.
llvm-svn: 93794
|
|
|
|
|
|
| |
nicer than passing around two const char*'s.
llvm-svn: 93094
|
|
|
|
| |
llvm-svn: 93084
|
|
|
|
|
|
|
| |
import other headers within the same framework with the full
framework path, not with a relative include.
llvm-svn: 93083
|
|
|
|
| |
llvm-svn: 92357
|
|
|
|
| |
llvm-svn: 91263
|
|
|
|
|
|
| |
should be forced to deal with error conditions.
llvm-svn: 90700
|
|
|
|
|
|
|
|
|
|
|
|
| |
in diagnostics when we fail to open a file. This allows us to
report things like:
$ clang test.c -I.
test.c:2:10: fatal error: error opening file './foo.h': Permission denied
#include "foo.h"
^
llvm-svn: 90276
|
|
|
|
|
|
|
|
|
|
| |
stat a file but where mmaping it fails. In this case, we emit an
error like:
t.c:1:10: fatal error: error opening file '../../foo.h'
instead of "cannot find file".
llvm-svn: 90110
|
|
|
|
| |
llvm-svn: 85589
|
|
|
|
| |
llvm-svn: 84436
|
|
|
|
| |
llvm-svn: 81346
|
|
|
|
| |
llvm-svn: 75517
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. When we accept "#garbage" in asm-with-cpp mode, change the token kind
of the # to unknown so that the preprocessor won't try to process it as
a real #. This fixes a crash on the attached example
2. Fix macro definition extents processing to handle #foo at the end of a
macro to say the definition ends with the foo, not the #.
This is a follow-on fix to r72283, and rdar://6916026
llvm-svn: 72388
|
|
|
|
|
|
| |
non-argument names, pass the tokens through.
llvm-svn: 72283
|
|
|
|
| |
llvm-svn: 72210
|
|
|
|
|
|
| |
patch by Alexei Svitkine!
llvm-svn: 69659
|
|
|
|
|
|
| |
Alexei Svitkine!
llvm-svn: 69656
|