summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* move a bunch of code for initializing the predefines buffer out of ↵Chris Lattner2009-04-101-335/+1
| | | | | | | | | | Preprocessor.cpp into clang-cc.cpp. This makes it so clang-cc constructs the *entire* predefines buffer, not just half of it. A bonus of this is that we get to kill a copy of DefineBuiltinMacro. llvm-svn: 68830
* simplify code.Chris Lattner2009-04-101-6/+4
| | | | llvm-svn: 68825
* PCH serialization/deserialization of the source manager. With thisDouglas Gregor2009-04-101-0/+4
| | | | | | | | | | | | improvement, source locations read from the PCH file will properly resolve to the source files that were used to build the PCH file itself. Once we have the preprocessor state stored in the PCH file, source locations that refer to macro instantiations that occur in the PCH file should have the appropriate instantiation information. llvm-svn: 68758
* 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
* More fixes to builtin preprocessor defines.Daniel Dunbar2009-04-081-2/+18
| | | | | | | | | | | | | | | | | | | | | - Add -static-define option driver can use when __STATIC__ should be defined (instead of __DYNAMIC__). - Don't set __OPTIMIZE_SIZE__ on Os, __OPTIMIZE_SIZE__ is tied to Oz. - Set __NO_INLINE__ following GCC 4.2. - Set __GNU_GNU_INLINE__ or __GNU_STDC_INLINE__ following GCC 4.2. - Set __EXCEPTIONS for Objective-C NonFragile ABI. - Set __STRICT_ANSI__ for standard conforming modes. - I added a clang style test case in utils for this, but its not particularly portable and I don't think it belongs in the test suite. llvm-svn: 68621
* Set __PIC__ (more) correctly.Daniel Dunbar2009-04-081-2/+11
| | | | | | | | | | | - Add -pic-level clang-cc option to specify the value for the define, updated driver to pass this. - Added __pic__ - Added OBJC_ZEROCOST_EXCEPTIONS define while I was here (to match gcc). llvm-svn: 68584
* The __weak and __strong defines are common to all darwin targetsChris Lattner2009-04-071-8/+2
| | | | | | | | | | | and are even set in C mode. As such, move them to Targets.cpp. __OBJC_GC__ is also darwin specific, but seems reasonable to always define it when in objc-gc mode. This fixes rdar://6761450 llvm-svn: 68494
* Define __OPTIMIZE__ and __OPTIMIZE_SIZE__ if the -O[12] and -Os flags are ↵Anders Carlsson2009-04-061-0/+5
| | | | | | passed to the compiler. llvm-svn: 68450
* fix rdar://6757323, where an escaped newline in a // commentChris Lattner2009-04-051-0/+8
| | | | | | was causing the char after the newline to get eaten. llvm-svn: 68430
* A code modification hint for files that don't end in a newline.Mike Stump2009-04-021-1/+3
| | | | | | | Eventually, would be nice to be able to run these modifications even when we don't want the warning or errors for the actual diagnostic. llvm-svn: 68272
* ProcessUCNEscape(): Incorportate some feedback from Chris.Steve Naroff2009-04-011-17/+21
| | | | llvm-svn: 68198
* Fix pascal string support; testcase from mailing list message.Eli Friedman2009-04-011-3/+4
| | | | llvm-svn: 68181
* Incorporate feedback from Eli.Steve Naroff2009-03-311-17/+11
| | | | llvm-svn: 68107
* Implement UCN support for C string literals (C99 6.4.3) and add some very ↵Steve Naroff2009-03-301-15/+102
| | | | | | | | basic tests. Chris Goller has graciously offered to write some test to help validate UCN support. From a front-end perspective, I believe this code should work for ObjC @-strings. At the moment, I believe we need to tweak the code generation for @-strings (which doesn't appear to handle them). Will be investigating. llvm-svn: 68076
* push line markers through -E mode.Chris Lattner2009-03-271-0/+22
| | | | llvm-svn: 67854
* Put back __OBJC2__ definition.Fariborz Jahanian2009-03-261-4/+0
| | | | llvm-svn: 67802
* - Minor change to dump of ivar layout map.Fariborz Jahanian2009-03-261-0/+4
| | | | | | | | - Temporarily undef'ed __OBJC2__ in nonfragile objc abi mode as it was forcing ivar synthesis in a certain project which clang does not yet support. llvm-svn: 67766
* fix PR3880, fixing a comma swallowing bug handling macros that only takeChris Lattner2009-03-251-0/+6
| | | | | | ... arguments. llvm-svn: 67706
* remove some dead code. ArgTokens can never be empty, because it is always Chris Lattner2009-03-251-9/+0
| | | | | | | | | | | | terminated with an EOF token. The condition it is trying to check for is handled by this code above. // Empty arguments are standard in C99 and supported as an extension in // other modes. if (ArgTokens.empty() && !Features.C99) Diag(Tok, diag::ext_empty_fnmacro_arg); llvm-svn: 67705
* change the __VERSION__ string to be more sensible. It would be useful to ↵Chris Lattner2009-03-241-2/+1
| | | | | | include the clang version # too. llvm-svn: 67619
* The individual pieces of an invalid paste as still candidates for expansion.Chris Lattner2009-03-231-1/+3
| | | | | | | This matters in assembler mode, where this is silently allowed. This fixes rdar://6709206. llvm-svn: 67539
* PTHManager::Create():Ted Kremenek2009-03-221-18/+16
| | | | | | | | | | | - Make the Diagnostic::Level for PTH errors to be specified by the caller clang (driver): - Set the PTHManager diagnostic level to "Diagnostic::Error" for -include-pth (a hard error) and Diagnostic::Warning for -token-cache (we can still proceed). llvm-svn: 67462
* Add back warning about a PTH file not containing any identifiers, but don't makeTed Kremenek2009-03-211-0/+6
| | | | | | it a hard error. llvm-svn: 67424
* Allow PTH files with no identifiers.Ted Kremenek2009-03-211-5/+0
| | | | llvm-svn: 67423
* rename the <predefines> buffer to <built-in> to solve PR3849.Chris Lattner2009-03-201-4/+11
| | | | | | | | | | | | | | Add a #include directive around the command line buffer so that diagnostics generated from -include directives get diagnostics like: In file included from <built-in>:98: In file included from <command line>:3: ./t.h:2:1: warning: type specifier missing, defaults to 'int' b; ^ llvm-svn: 67396
* 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
OpenPOWER on IntegriCloud