summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPDirectives.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* switch the macroinfo argument lists from being allocated off the heapChris Lattner2009-02-201-4/+4
| | | | | | | | | to being allocated from the same bumpptr that the MacroInfo objects themselves are. This speeds up -Eonly cocoa.h pth by ~4%, fsyntax-only is barely measurable. llvm-svn: 65195
* detemplatify setArgumentList and some other cleanups.Chris Lattner2009-02-201-7/+5
| | | | llvm-svn: 65187
* require the MAcroInfo objects are explcitly destroyed.Chris Lattner2009-02-201-3/+11
| | | | llvm-svn: 65179
* Fix PR3464 by searching for headers from the predefinesChris Lattner2009-02-041-2/+13
| | | | | | buffer as if the #include happened from the main file. llvm-svn: 63764
* Implement handling of file entry/exit notifications from GNUChris Lattner2009-02-041-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | line markers, including maintenance of the virtual include stack. For something like this: # 42 "bar.c" 1 # 142 "bar2.c" 1 #warning zappa # 92 "bar.c" 2 #warning gonzo # 102 "foo.c" 2 #warning bonkta we now produce these three warnings: #1: In file included from foo.c:3: In file included from bar.c:42: bar2.c:143:2: warning: #warning zappa #warning zappa ^ #2: In file included from foo.c:3: bar.c:92:2: warning: #warning gonzo #warning gonzo ^ #3: foo.c:102:2: warning: #warning bonkta #warning bonkta ^ llvm-svn: 63722
* propagate linemarker flags down into the the line table, currentlyChris Lattner2009-02-041-4/+6
| | | | | | ignoring include stack push/pop info though. llvm-svn: 63719
* stub out basic #line handling calls.Chris Lattner2009-02-031-5/+3
| | | | llvm-svn: 63667
* move library-specific diagnostic headers into library private dirs. ReduceChris Lattner2009-01-291-1/+1
| | | | | | redundant #includes. Patch by Anders Johnsen! llvm-svn: 63271
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-1/+1
| | | | | | | | | .def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! llvm-svn: 63111
* Fix a bug that I noticed by inspection.Chris Lattner2009-01-271-0/+1
| | | | llvm-svn: 63094
* remove my hacks that aggressively threw away multiple Chris Lattner2009-01-261-12/+0
| | | | | | | | | | | instantiation history in an effort to speed up c99-intconst-1.c. Now that multiple nested instantiations are allowed, we just make them and don't pay the cost of lookups. With the other changes that went in before this, reverting this is actually a speedup for c99-intconst-1.c, speeding it up from 1.96s to 1.80s, and preserves much better loc info. llvm-svn: 63036
* start plumbing together the line table information. So far we justChris Lattner2009-01-261-6/+32
| | | | | | unique the Filenames in #line directives, assigning them UIDs. llvm-svn: 63010
* add parsing and constraint enforcement for GNU line marker directives.Chris Lattner2009-01-261-35/+148
| | | | llvm-svn: 63003
* a few minor cleanupsChris Lattner2009-01-261-2/+6
| | | | llvm-svn: 63000
* parse and enforce required constraints on #line directives. Right nowChris Lattner2009-01-261-14/+86
| | | | | | we just discard them. llvm-svn: 62999
* Eagerly resolve the spelling location of the tokens in a definitionChris Lattner2009-01-261-0/+12
| | | | | | | | | | | | of a macro. Since these tokens may themselves be from macro expansions, we need to resolve down to the spelling loc when the macro ends up being instantiated. Instead of resolving this for each token expanded from the macro definition, just do it once when the macro is defined. This speeds up clang on c99-intconst-1.c from 2.66s to 2.43s (9.5%), reducing the FileID lookups from 407244 linear and 114175649 binary to 2529040 linear and 64771121 binary. llvm-svn: 62993
* do not use SourceManager::getFileCharacteristic(FileID), it is notChris Lattner2009-01-191-1/+1
| | | | | | | safe because a #line can change the file characteristic on a per-loc basis. llvm-svn: 62501
OpenPOWER on IntegriCloud