summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* Clean up and document code modification hints.Douglas Gregor2009-02-271-1/+19
| | | | llvm-svn: 65641
* fix some sema problems with wide strings and hook up basic codegen for them.Chris Lattner2009-02-261-9/+1
| | | | llvm-svn: 65582
* Move PTHStatCache within the anonymous namespace.Ted Kremenek2009-02-231-1/+1
| | | | llvm-svn: 65348
* switch the macroinfo argument lists from being allocated off the heapChris Lattner2009-02-202-5/+5
| | | | | | | | | 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-202-8/+5
| | | | llvm-svn: 65187
* require the MAcroInfo objects are explcitly destroyed.Chris Lattner2009-02-202-3/+12
| | | | llvm-svn: 65179
* Fix another PTH warning that should not be a note.Ted Kremenek2009-02-191-1/+1
| | | | llvm-svn: 65072
* Make PTH warnings actual warnings instead of 'notes'.Ted Kremenek2009-02-191-1/+1
| | | | llvm-svn: 65071
* fix PR3609, emit:Chris Lattner2009-02-191-1/+1
| | | | | | | | | | | | | | t.c:1:10: error: missing terminating '>' character #include <stdio.h ^ instead of: t.c:1:10: error: missing terminating " character #include <stdio.h ^ llvm-svn: 65052
* Next step toward making string diagnostics correct: handleChris Lattner2009-02-181-0/+46
| | | | | | | | | | | | | escapes in the string for subtoken positioning. This gives us working examples like: t.m:5:16: warning: field width should have type 'int', but argument has type 'unsigned int' printf("\n\n%*d", (unsigned) 1, 1); ^ ~~~~~~~~~~~~ where before the caret pointed two spaces to the left. llvm-svn: 64940
* update comment.Chris Lattner2009-02-181-5/+1
| | | | llvm-svn: 64939
* Fix some issues handling sub-token locations that come from macro expansions.Chris Lattner2009-02-181-1/+1
| | | | | | | | | | | | | | | We now emit: t.m:6:15: warning: field width should have type 'int', but argument has type 'unsigned int' printf(STR, (unsigned) 1, 1); ^ ~~~~~~~~~~~~ t.m:3:18: note: instantiated from: #define STR "abc%*ddef" ^ which has the correct location in the string literal in the note line. llvm-svn: 64936
* define __OBJC2__ for objc's nonfragile abi.Fariborz Jahanian2009-02-161-0/+2
| | | | llvm-svn: 64642
* Add support for deprecated members of RecordDecls (e.g. struct fields).Chris Lattner2009-02-161-2/+0
| | | | llvm-svn: 64634
* add a new SourceManager::getInstantiationRange helper method.Chris Lattner2009-02-151-3/+1
| | | | llvm-svn: 64606
* fix PR3579: __LINE__ expands to the presumed location of the Chris Lattner2009-02-151-1/+11
| | | | | | | | *end* of a macro instantiation, not the start of it. This is really all about bug-for-bug compatibility with GCC, but not doing this breaks the FreeBSD kernel. llvm-svn: 64604
* track "just a little more" location information for macro instantiations.Chris Lattner2009-02-156-25/+49
| | | | | | | | | | | | Now instead of just tracking the expansion history, also track the full range of the macro that got replaced. For object-like macros, this doesn't change anything. For _Pragma and function-like macros, this means we track the locations of the ')'. This is required for PR3579 because apparently GCC uses the line of the ')' of a function-like macro as the location to expand __LINE__ to. llvm-svn: 64601
* add an assertion from Alexei Svitkine!Chris Lattner2009-02-131-2/+2
| | | | llvm-svn: 64503
* Give TargetInfo a new IntPtrType to hold the intptr_t type forChris Lattner2009-02-131-0/+1
| | | | | | | | | | a target. Make Preprocessor.cpp define a new __INTPTR_TYPE__ macro based on this. On linux/32, set intptr_t to int, instead of long. This fixes PR3563. llvm-svn: 64495
* PTH: Cache directory and negative 'stat' calls. This gives us a 1% ↵Ted Kremenek2009-02-131-3/+9
| | | | | | performance improvement on Cocoa.h (fsyntax-only+PTH). llvm-svn: 64490
* Fix rdar://6562329, a static analyzer crash Ted noticed on Chris Lattner2009-02-131-1/+4
| | | | | | | | | | | | | | wine sources. This was happening because HighlightMacros was calling EnterMainFile multiple times on the same preprocessor object and getting an assert due to the new #line stuff (the file in question was bison output with #line directives). The fix for this is to not reenter the file. Instead, relex the tokens in raw mode, swizzle them a bit and repreprocess the token stream. An added bonus of this is that rewrite macros will now hilight the macro definition as well as its uses. Woo. llvm-svn: 64480
* Add some boilerplate to the PTH file to prepare for the caching of stats for ↵Ted Kremenek2009-02-131-29/+55
| | | | | | directories (and negative stats too). llvm-svn: 64477
* Fix cmake builds.Mike Stump2009-02-131-0/+1
| | | | llvm-svn: 64455
* Fix gcc warning: gcc correctly notes that const-qualifying the return Eli Friedman2009-02-131-2/+2
| | | | | | type doesn't do anything. llvm-svn: 64424
* factor token concatenation avoidance logic out of Chris Lattner2009-02-131-0/+205
| | | | | | PrintPreprocessedOutput into its own file. No functionality change. llvm-svn: 64418
* Fix assertion when input is an empty string.Daniel Dunbar2009-02-121-1/+1
| | | | llvm-svn: 64397
* Re-enable PTH stat caching. All tests pass now.Ted Kremenek2009-02-121-2/+1
| | | | llvm-svn: 64356
* Fix bad reading of bytes in ReadUnalignedLE64() (copy-paste error).Ted Kremenek2009-02-121-4/+4
| | | | llvm-svn: 64355
* Temporarily disable PTH stat caching as it appears to be failing on some ↵Ted Kremenek2009-02-121-1/+2
| | | | | | machines. llvm-svn: 64354
* PTH: Cache stat information for files in the PTH file. Hook up FileManagerTed Kremenek2009-02-122-10/+106
| | | | | | | | | | | | | to use this stat information in the PTH file using a 'StatSysCallCache' object. Performance impact (Cocoa.h, PTH): - number of stat calls reduces from 1230 to 425 - fsyntax-only: time improves by 4.2% We can reduce the number of stat calls to almost zero by caching negative stat calls and directory stat calls in the PTH file as well. llvm-svn: 64353
* PTH: Have meta data be at the beginning of the PTH file, not the end.Ted Kremenek2009-02-111-6/+6
| | | | llvm-svn: 64338
* PTH: Replace string identifier to persistent ID lookup with a hashtable. This isTed Kremenek2009-02-111-54/+89
| | | | | | | actually *slightly* slower than the binary search. Since this is algorithmically better, further performance tuning should be able to make this faster. llvm-svn: 64326
* PTH: Don't emit the PTH offset of the IdentifierInfo string data as that data isTed Kremenek2009-02-111-4/+4
| | | | | | referenced by other tables. llvm-svn: 64304
* PTH: Replace ad hoc 'file name' -> 'PTH data' lookup table in the PTH file ↵Ted Kremenek2009-02-101-52/+158
| | | | | | with an on-disk chained hash table. This data structure is implemented using templates, and will be used to replace similar data structures. This change leads to no visibile performance impact on Cocoa.h, but now we only pay a price for the table on order with the number of files accessed and not the number in the PTH file. llvm-svn: 64245
* Export __INT8_TYPE__ / __INT16_TYPE__ / __INT32_TYPE__ / __INT64_TYPE__Chris Lattner2009-02-061-8/+29
| | | | | | | in a gcc 4.5 compatible way so that stdint.h can follow the compiler's notion of types. llvm-svn: 63976
* -funsigned-char sets __CHAR_UNSIGNED__Chris Lattner2009-02-061-0/+3
| | | | llvm-svn: 63942
* Add an implementation of -dM that follows GCC closely enough to permitChris Lattner2009-02-061-1/+1
| | | | | | | diffing the output of: clang -dM -o - -E -x c foo.c | sort llvm-svn: 63926
* add interface for walking macro table.Chris Lattner2009-02-061-3/+1
| | | | llvm-svn: 63925
* get __WCHAR_TYPE__ from the targetinfo hookChris Lattner2009-02-061-4/+4
| | | | llvm-svn: 63920
* simplify and refactor a bunch of type definition code in PreprocessorChris Lattner2009-02-061-60/+13
| | | | | | predefines buffer initialization. llvm-svn: 63919
* remove some ad-hocery and use DefineTypeSize for more things.Chris Lattner2009-02-061-27/+7
| | | | | | Now you too can have a 47 bit long long! llvm-svn: 63918
* refactor some code into a DefineTypeSize function.Chris Lattner2009-02-061-6/+21
| | | | llvm-svn: 63917
* correct and generalize computation of __INTMAX_MAX__.Chris Lattner2009-02-051-4/+16
| | | | llvm-svn: 63848
* fix some differences between apple gcc and clang on darwin/x86-32.Chris Lattner2009-02-051-2/+8
| | | | llvm-svn: 63846
* 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-2911-11/+11
| | | | | | redundant #includes. Patch by Anders Johnsen! llvm-svn: 63271
* Add more PTH diagnostics for invalid PTH files, etc.Ted Kremenek2009-01-281-11/+29
| | | | llvm-svn: 63232
OpenPOWER on IntegriCloud