summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* suck the rest of the FP macros out of the targets into the PPChris Lattner2008-10-051-4/+42
| | | | llvm-svn: 57137
* start moving fp macros overChris Lattner2008-10-051-2/+38
| | | | llvm-svn: 57134
* move a bunch more integer sizing out of target-specific code intoChris Lattner2008-10-051-0/+49
| | | | | | | | | | target indep code. Note that this changes functionality on PIC16: it defines __INT_MAX__ correctly for it, and it changes sizeof(long) to 16-bits (to match the size of pointer). llvm-svn: 57132
* eliminate __USER_LABEL_PREFIX__ from the Targets.cpp file, start movingChris Lattner2008-10-051-6/+23
| | | | | | integer size #defines over to the Preprocessor. llvm-svn: 57130
* gcc no longer defines __block to nothing when blocks aren't enabled.Chris Lattner2008-10-051-4/+1
| | | | llvm-svn: 57129
* rearrange preprocessor macro definitions into language-specificChris Lattner2008-10-051-44/+51
| | | | | | then target specific. llvm-svn: 57128
* Implement PR2773, support for __USER_LABEL_PREFIX__Chris Lattner2008-10-051-0/+7
| | | | llvm-svn: 57127
* define __PASCAL_STRINGS__ whenever -fpascal-strings is enabled.Chris Lattner2008-09-301-0/+4
| | | | llvm-svn: 56824
* __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ is a darwin-specific #defineChris Lattner2008-09-301-1/+1
| | | | llvm-svn: 56822
* Fix the rest of rdar://6243860 hopefully. This requires changing FileIDInfoChris Lattner2008-09-261-11/+0
| | | | | | | | | | | to whether the fileid is a 'extern c system header' in addition to whether it is a system header, most of this is spreading plumbing around. Once we have that, PPLexerChange bases its "file enter/exit" notifications to PPCallbacks to base the system header state on FileIDInfo instead of HeaderSearch. Finally, in Preprocessor::HandleIncludeDirective, mirror logic in GCC: the system headerness of a file being entered can be set due to the #includer or the #includee. llvm-svn: 56688
* Update clang to pretend to be gcc-4.2.Daniel Dunbar2008-09-261-4/+4
| | | | | | - This really needs to be automated and configurable. llvm-svn: 56635
* Fix <rdar://problem/6240065> clang: __BLOCKS__ should be defined.Steve Naroff2008-09-231-2/+3
| | | | llvm-svn: 56503
* - Implement __block.Steve Naroff2008-09-021-3/+10
| | | | | | - Replace FIXME in Preprocessor::HandleIdentifier() with a check that avoids diagnosing extension tokens that originate from macro definitions. llvm-svn: 55639
* Pull code from last commit. will put back soon.Steve Naroff2008-09-021-7/+0
| | | | llvm-svn: 55637
* Implement block pseudo-storage class modifiers (__block, __byref).Steve Naroff2008-09-021-0/+7
| | | | llvm-svn: 55635
* Add a safety check.Argyrios Kyrtzidis2008-08-231-0/+2
| | | | | | Make sure there's no "dangling" backtrack position when Preprocessor is destroyed. llvm-svn: 55236
* Move some ObjC preprocessor definitions intoDaniel Dunbar2008-08-121-1/+18
| | | | | | | InitializePredefinedMacros(). - Also now properly wired to -fobjc-gc, -fnext-runtime. llvm-svn: 54661
* remove obsolete comment.Chris Lattner2008-08-111-13/+0
| | | | llvm-svn: 54652
* * Remove isInSystemHeader() from DiagClient, move it to SourceManagerNico Weber2008-08-101-0/+11
| | | | | | | | | | | | | | | | * Move FormatError() from TextDiagnostic up to DiagClient, remove now empty class TextDiagnostic * Make DiagClient optional for Diagnostic This fixes the following problems: * -html-diags (and probably others) does now output the same set of warnings as console clang does * nothing crashes if one forgets to call setHeaderSearch() on TextDiagnostic * some code duplication is removed llvm-svn: 54620
* Allow the preprocessor to cache the lexed tokens, so that we can do ↵Argyrios Kyrtzidis2008-08-101-1/+3
| | | | | | | | | | | | | | | efficient lookahead and backtracking. 1) New public methods added: -EnableBacktrackAtThisPos -DisableBacktrack -Backtrack -isBacktrackEnabled 2) LookAhead() implementation is replaced with a more efficient one. 3) LookNext() is removed. llvm-svn: 54611
* Patch byTed Kremenek2008-07-191-1/+1
| | | | | | | "When dumping the tokens (-dumptokens output type), the column numbers are not correctly shown. This patch fixes that issue." llvm-svn: 53796
* move the linux predefined macro definition to the TargetInfo, where it ↵Nuno Lopes2008-07-051-5/+0
| | | | | | really belongs llvm-svn: 53149
* predefine the macro linux when compiled on a linux system. this fixes the ↵Nuno Lopes2008-07-051-0/+5
| | | | | | build of libtidy llvm-svn: 53145
* clang uses the llvm backend, so define __llvm__ like llvm-gcc. Chris Lattner2008-06-261-0/+3
| | | | | | | Additionally, define __clang__ so clients can predicate based on clang features. llvm-svn: 52788
* Fix rewriter bug <rdar://problem/5929344> clang ObjC rewriter: "extern int ↵Steve Naroff2008-05-151-0/+2
| | | | | | | | __CFConstantStringClassReference[];" should be extern "C". Have clang predefine OBJC_NEW_PROPERTIES (which is what gcc does). llvm-svn: 51163
* DO NOT pre-defined __OBJC2__. The __OBJC2__ macro should only be defined ↵Steve Naroff2008-05-091-2/+0
| | | | | | when targeting the new, Apple 2.0 *runtime ABI*. It is not intended to be used to #ifdef ObjC 2.0 langauge features. This is unfortunate (given it's name). In a perfect world, this defined would be named __OBJC2_RUNTIME_ABI__. Oh well. llvm-svn: 50913
* Neil pointed out that clang doesn't generate ranges from diagnosticsChris Lattner2008-05-051-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | related to pp-expressions. Doing so is pretty simple and this patch implements it, yielding nice diagnostics like: t.c:2:7: error: division by zero in preprocessor expression #if 1 / (0 + 0) ~ ^ ~~~~~~~ t.c:5:14: error: expected ')' in preprocessor expression #if (412 + 42 ~~~~~~~~^ t.c:5:5: error: to match this '(' #if (412 + 42 ^ t.c:10:10: warning: left side of operator converted from negative value to unsigned: -42 to 18446744073709551574 #if (-42 + 0U) / -2 ~~~ ^ ~~ t.c:10:16: warning: right side of operator converted from negative value to unsigned: -2 to 18446744073709551614 #if (-42 + 0U) / -2 ~~~~~~~~~~ ^ ~~ 5 diagnostics generated. llvm-svn: 50638
* simplify ownership of the predefines buffer.Chris Lattner2008-04-191-5/+1
| | | | llvm-svn: 49973
* class Preprocessor: Now owns the "predefines" char*; it deletes [] it in its ↵Ted Kremenek2008-04-171-0/+2
| | | | | | | | | | | | | | | | | dstor. clang.cpp: InitializePreprocessor now makes a copy of the contents of PredefinesBuffer and passes it to the preprocessor object. clang.cpp: DriverPreprocessorFactory now calls "InitializePreprocessor" instead of this being done in main(). html::HighlightMacros() now takes a PreprocessorFactory, allowing it to conjure up a new Preprocessor to highlight macros. class HTMLDiagnostics now takes a PreprocessorFactory* that it can use for html::HighlightMacros(). Updated clients of HTMLDiagnostics to use this new interface. llvm-svn: 49875
* Added "PreprocessorFactory", an interface for lazily creating Preprocessor ↵Ted Kremenek2008-04-171-0/+2
| | | | | | objects on-demand. llvm-svn: 49868
* move #include to the file that needs it.Chris Lattner2008-03-181-1/+0
| | | | llvm-svn: 48485
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+560
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud