summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* PTHManager::Create() now creates a PTHManager even if the PTH file contains noTed Kremenek2009-03-201-4/+5
| | | | | | cached tokens. This is for use with -include-pth. llvm-svn: 67385
* pass LangOptions into TargetInfo::getTargetDefines, so that targetsChris Lattner2009-03-201-1/+1
| | | | | | can have language-specific defines. llvm-svn: 67375
* Add PTHManager::getOriginalSourceFile(), a method that returns the name of theTed Kremenek2009-03-191-3/+12
| | | | | | original source file (if any) that was used to generate the PTH cache. llvm-svn: 67343
* silence some errors that should not apply to .S files on code like:Chris Lattner2009-03-181-4/+4
| | | | | | | | '' ' ' llvm-svn: 67237
* when preprocessing a .S file, unknown directives should just be passed through,Chris Lattner2009-03-182-1/+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
* properly form a full token for # before calling HandleDirective.Chris Lattner2009-03-181-6/+7
| | | | llvm-svn: 67235
* This is not considered a preprocessor directive in .S files:Chris Lattner2009-03-181-0/+2
| | | | | | # 4 llvm-svn: 67233
* constructs like:Chris Lattner2009-03-181-3/+4
| | | | | | | | | #define Y X ## . Y are ok in .S files. llvm-svn: 67231
* Fix -E mismatch; an identifier followed by a numeric constant does notDaniel Dunbar2009-03-181-22/+31
| | | | | | | | require a space (to avoid concatenation) if the numeric constant had a leading period. - PR3819. llvm-svn: 67163
* typoGabor Greif2009-03-171-1/+1
| | | | llvm-svn: 67081
* Build system changes to use TableGen to generate the variousDouglas Gregor2009-03-162-1/+3
| | | | | | | | | | | | | | | | | | diagnostics. This builds on the patch that Sebastian committed and then revert. Major differences are: - We don't remove or use the current ".def" files. Instead, for now, we just make sure that we're building the ".inc" files. - Fixed CMake makefiles to run TableGen and build the ".inc" files when needed. Tested with both the Xcode and Makefile generators provided by CMake, so it should be solid. - Fixed normal makefiles to handle out-of-source builds that involve the ".inc" files. I'll send a separate patch to the list with Sebastian's changes that eliminate the use of the .def files. llvm-svn: 67058
* (Hopefully) instantiate dependent array types correctly.Anders Carlsson2009-03-151-0/+3
| | | | llvm-svn: 67032
* make Preprocessor::Diags be a pointer instead of a reference.Chris Lattner2009-03-131-1/+1
| | | | llvm-svn: 66955
* use accessor instead of poking ivar directlyChris Lattner2009-03-132-2/+3
| | | | llvm-svn: 66954
* add a callback for macro expansion, based on a patch by Paolo Bolzoni!Chris Lattner2009-03-121-0/+2
| | | | llvm-svn: 66799
* fix PR3768, Clang does -D__STDC_HOSTED__=1, even if -ffreestanding is passed.Chris Lattner2009-03-091-1/+5
| | | | llvm-svn: 66474
* fix PR3764 - A redefinition of a pre-processor macro failsChris Lattner2009-03-091-3/+8
| | | | | | | Redefinition checking should ignore the leading whitespace and start of line flags on the first token of an expansion. llvm-svn: 66442
* add \n characters to the scratch buffer *before* returned tokens. Chris Lattner2009-03-081-3/+7
| | | | | | | | This prevents caret diagnostics from the scratch buffer from including other tokens in the scratch buffer that occurred beforei them. llvm-svn: 66375
* simplify some logic by making ScratchBuffer handle the application of trailingChris Lattner2009-03-085-60/+49
| | | | | | | \0's to created tokens instead of making all clients do it. No functionality change. llvm-svn: 66373
* Fix warnings in build on clang-x86_64-freebsd buildbot.Mike Stump2009-03-071-1/+1
| | | | llvm-svn: 66344
* #import is not considered an extension for ObjC.Chris Lattner2009-03-061-1/+2
| | | | llvm-svn: 66246
* make the token lexer allocate its temporary token buffers forChris Lattner2009-03-041-2/+9
| | | | | | | preexpanded macro arguments from the preprocessor's bump pointer. This reduces # mallocs from 12444 to 11792. llvm-svn: 66025
* improve compatibility with GCC 4.4, patch by Michel Salim (PR3697)Chris Lattner2009-03-024-0/+4
| | | | llvm-svn: 65884
* 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
OpenPOWER on IntegriCloud