summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPDirectives.cpp
Commit message (Collapse)AuthorAgeFilesLines
* push some source location information down through the compiler,Chris Lattner2010-04-201-6/+2
| | | | | | | | into ContentCache::getBuffer. This allows it to produce diagnostics on the broken #include line instead of without a location. llvm-svn: 101939
* add a PPCallback handler for a skipped #include, patch byChris Lattner2010-04-191-6/+9
| | | | | | Zhanyong Wan! llvm-svn: 101813
* Improve line marker directive locations, patch by Jordy RoseChris Lattner2010-04-141-2/+3
| | | | llvm-svn: 101226
* Reinstate my CodeModificationHint -> FixItHint renaming patch, withoutDouglas Gregor2010-03-311-3/+3
| | | | | | the C-only "optimization". llvm-svn: 100022
* Revert r100008, which inexplicably breaks the clang-i686-darwin10 builderDouglas Gregor2010-03-311-3/+3
| | | | llvm-svn: 100018
* Rename CodeModificationHint to FixItHint, since we've been using theDouglas Gregor2010-03-311-3/+3
| | | | | | | term "fix-it" everywhere and even *I* get tired of long names sometimes. No functionality change. llvm-svn: 100008
* Audit all Preprocessor::getSpelling() callers, improving failureDouglas Gregor2010-03-161-5/+16
| | | | | | recovery for those that need it. llvm-svn: 98689
* Audit all callers of SourceManager::getCharacterData(); update some ofDouglas Gregor2010-03-161-1/+6
| | | | | | them to recover more gracefully on failure. llvm-svn: 98672
* Use SmallString instead of SmallVectorKovarththanan Rajaratnam2010-03-131-5/+5
| | | | llvm-svn: 98436
* Add an overload of Preprocessor::getSpelling which takes a SmallVector andBenjamin Kramer2010-02-271-6/+2
| | | | | | returns a StringRef. Use it to simplify some repetitive code. llvm-svn: 97322
* Fix PR6282: the include guard optimization cannot happen if theChris Lattner2010-02-121-7/+10
| | | | | | | | 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
* revert my patch for rdar://7520940 that warns when a published headerChris Lattner2010-01-221-13/+2
| | | | | | | is #included with "foo.h" style syntax instead of framework syntax. It produced too much noise. llvm-svn: 94120
* simplify the code for skipping in a #if 0 block. The CurLexerChris Lattner2010-01-181-4/+1
| | | | | | | pointer is always non-null because the PTH case exits earlier in the method. llvm-svn: 93794
* stringref'ize a bunch of filename handling logic. MuchChris Lattner2010-01-101-38/+28
| | | | | | nicer than passing around two const char*'s. llvm-svn: 93094
* clarify comment.Chris Lattner2010-01-101-2/+2
| | | | llvm-svn: 93084
* implement rdar://7520940: published framework headers shouldChris Lattner2010-01-101-2/+13
| | | | | | | import other headers within the same framework with the full framework path, not with a relative include. llvm-svn: 93083
* Convert to StringRef, avoid a memcpy in the common case.Benjamin Kramer2009-12-311-19/+16
| | | | llvm-svn: 92357
* formatting changes.Chris Lattner2009-12-141-4/+5
| | | | llvm-svn: 91263
* Change Preprocessor::EnterSourceFile to make ErrorStr non-optional, clients ↵Daniel Dunbar2009-12-061-1/+1
| | | | | | should be forced to deal with error conditions. llvm-svn: 90700
* pass the reason for failure up from MemoryBuffer and report itChris Lattner2009-12-011-2/+3
| | | | | | | | | | | | 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
* Fix PR5633 by making the preprocessor handle the case where we canChris Lattner2009-11-301-1/+4
| | | | | | | | | | 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
* Re-arranged some internal functions for coming __has_include changes.John Thompson2009-10-301-7/+7
| | | | llvm-svn: 85589
* Move clients to use IdentifierInfo::getNameStart() instead of getName()Daniel Dunbar2009-10-181-1/+1
| | | | llvm-svn: 84436
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-175/+175
| | | | llvm-svn: 81346
* There is no need to value initialize this array.Daniel Dunbar2009-07-131-1/+1
| | | | llvm-svn: 75517
* Fix a couple of bugs:Chris Lattner2009-05-251-18/+27
| | | | | | | | | | | | 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
* In assembler-with-cpp mode, don't error on '#' (stringize) operator applied toDaniel Dunbar2009-05-221-3/+5
| | | | | | non-argument names, pass the tokens through. llvm-svn: 72283
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-2/+2
| | | | llvm-svn: 72210
* improve MacroInfo to track the source range of the macro definition,Chris Lattner2009-04-211-1/+10
| | | | | | patch by Alexei Svitkine! llvm-svn: 69659
* add a preprocessor callback function for #undef, patch byChris Lattner2009-04-211-1/+5
| | | | | | Alexei Svitkine! llvm-svn: 69656
* Fix PR4006, incorrect handling of __VA_ARGS__ when it was the first tokenChris Lattner2009-04-191-9/+9
| | | | | | | in a function-like macro body. This has the added bonus of moving some function-like macro specific code out of the object-like macro codepath. llvm-svn: 69530
* more fun with line markers: the digit string is required to be interpretedChris Lattner2009-04-181-23/+23
| | | | | | | as decimal, even if it starts with 0. Also, since things like 0x1 are completely illegal, don't even bother using numericliteralparser for them. llvm-svn: 69454
* second half of PR3940: #line requires simple digit sequence.Chris Lattner2009-04-181-1/+2
| | | | llvm-svn: 69422
* enforce requirements imposed by C90 6.8 TC1, fixing PR3919.Chris Lattner2009-04-181-11/+26
| | | | llvm-svn: 69415
* Fix PR3938 by taking into account C99 6.10p4.Chris Lattner2009-04-181-1/+1
| | | | llvm-svn: 69413
* Fix two problems from PR3916, and one problem I noticed while hackingChris Lattner2009-04-171-2/+5
| | | | | | on the code. llvm-svn: 69404
* implement PR3940: #line numbers not fully checkedChris Lattner2009-04-171-0/+5
| | | | llvm-svn: 69403
* #line is allowed to have macros that expand to nothing after them.Chris Lattner2009-04-171-7/+13
| | | | llvm-svn: 69401
* Offer a fixit hint for our warning about tokens at the end of a directive:Chris Lattner2009-04-141-1/+7
| | | | | | | | | | | | | t.c:3:8: warning: extra tokens at end of #endif directive #endif foo ^ // Don't do this in strict-C89 mode because bcpl comments aren't valid there, and it is too much trouble to analyze whether C block comments are safe. llvm-svn: 69024
* Fix the #import / #include_next "extra tokens at end of #foo directive" Chris Lattner2009-04-141-9/+9
| | | | | | | Warning to properly report that it is an import/include_next instead of claiming it is a #include. llvm-svn: 69023
* Fix assertion failure in PTH when tokens followed a closing #endif.Daniel Dunbar2009-04-131-3/+2
| | | | | | | | | - Ted, please check. - Missing test case because PTH won't reliably cache the tokens in a test case. *cough* llvm-svn: 68966
* add a ppcallback hook for macro definitions.Chris Lattner2009-04-121-0/+4
| | | | llvm-svn: 68883
* finish the implementation of -imacros. The driver still needs to be hooked up.Chris Lattner2009-04-081-4/+10
| | | | llvm-svn: 68640
* reject the #__include_macros directive unless it comes from the Chris Lattner2009-04-081-1/+20
| | | | | | predefines buffer. llvm-svn: 68627
* Add initial support for -imacros. Right now it has the same semantics asChris Lattner2009-04-081-2/+4
| | | | | | -include, but that will be fixed soon. llvm-svn: 68625
* push line markers through -E mode.Chris Lattner2009-03-271-0/+22
| | | | llvm-svn: 67854
* when preprocessing a .S file, unknown directives should just be passed through,Chris Lattner2009-03-181-0/+19
| | | | | | | | | | | | | | and the token after the # should be expanded if it is not a valid directive. This allows us to transform things like: #define FOO BAR # FOO into # BAR, even though FOO is not normally expanded for directives. This should fix PR3833 llvm-svn: 67236
* This is not considered a preprocessor directive in .S files:Chris Lattner2009-03-181-0/+2
| | | | | | # 4 llvm-svn: 67233
* use accessor instead of poking ivar directlyChris Lattner2009-03-131-1/+1
| | | | llvm-svn: 66954
* #import is not considered an extension for ObjC.Chris Lattner2009-03-061-1/+2
| | | | llvm-svn: 66246
OpenPOWER on IntegriCloud