summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPMacroExpansion.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Downgrade the error about rvalue references to an extension warningDouglas Gregor2011-01-251-2/+2
| | | | | | | | and turn on __has_feature(cxx_rvalue_references). The core rvalue references proposal seems to be fully implemented now, pending lots more testing. llvm-svn: 124169
* Eradicate any mention of C++0x concepts.Douglas Gregor2011-01-191-1/+0
| | | | llvm-svn: 123860
* Variadic templates are fully implemented.Douglas Gregor2011-01-191-1/+1
| | | | | | | | Turn on the __has_feature switch for variadic templates, document their completion, and put the ExtWarn into the c++0x-extensions warning group. llvm-svn: 123854
* clean up some dead code around __has_include() processing code identified by ↵Chris Lattner2011-01-151-13/+12
| | | | | | | | the ted-o-matic. rdar://8867482 llvm-svn: 123522
* Fix diagnostic pragmas.Argyrios Kyrtzidis2010-12-151-1/+9
| | | | | | | | | | | | Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state. Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect a lot of places, like C++ inline methods, template instantiations, the lexer, etc. Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location. Fixes rdar://8365684. llvm-svn: 121873
* Revert r119838 "Don't warn for empty 'if' body if there is a macro that ↵Argyrios Kyrtzidis2010-11-201-1/+1
| | | | | | | | | | expands to nothing" and use a better and more general approach, where NullStmt has a flag to indicate whether it was preceded by an empty macro. Thanks to Abramo Bagnara for the hint! llvm-svn: 119887
* Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:Argyrios Kyrtzidis2010-11-191-0/+1
| | | | | | | | | if (condition) CALL(0); // empty macro but don't warn for empty body. Fixes rdar://8436021. llvm-svn: 119838
* Make sure to always check the result ofDouglas Gregor2010-11-121-7/+14
| | | | | | | SourceManager::getPresumedLoc(), so that we don't try to make use of an invalid presumed location. Doing so can cause crashes. llvm-svn: 118885
* lib/Lex/PPMacroExpansion.cpp: Fixup to appease MSVC.NAKAMURA Takumi2010-11-091-0/+4
| | | | | | Confirmed on MSVS10. llvm-svn: 118496
* Appeasing MSVC, take 3Douglas Gregor2010-11-091-0/+1
| | | | llvm-svn: 118493
* Try to appease MSVCDouglas Gregor2010-11-091-0/+5
| | | | llvm-svn: 118487
* sprintf -> snprintf conversion, from Vladimir KirillovDouglas Gregor2010-11-091-3/+3
| | | | llvm-svn: 118478
* Document Clang's support for attributes on individual enumerators andJohn McCall2010-11-081-0/+3
| | | | | | | tweak the documentation for deprecation-with-message. Provide __has_feature tests for both. rdar://problem/8605692 llvm-svn: 118435
* Make the deserialization of macro definitions lazy, so that we canDouglas Gregor2010-10-301-0/+15
| | | | | | | | | load identifiers without loading their corresponding macro definitions. This is likely to improve PCH performance slightly, and reduces deserialization stack depth considerably when using preprocessor metaprogramming. llvm-svn: 117750
* Extend the preprocessing record and libclang with support forDouglas Gregor2010-10-201-2/+3
| | | | | | | | | inclusion directives, keeping track of every #include, #import, etc. in the translation unit. We keep track of the source location and kind of the inclusion, how the file name was spelled, and the underlying file to which the inclusion resolved. llvm-svn: 116952
* Add a __has_attribute macro that works much like __has_feature and ↵Anders Carlsson2010-10-201-2/+14
| | | | | | __has_builtin. llvm-svn: 116906
* Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked aDouglas Gregor2010-10-081-0/+1
| | | | | | bit by me). llvm-svn: 116122
* Implement the C++0x "trailing return type" feature, e.g.,Douglas Gregor2010-10-011-0/+1
| | | | | | | | | | auto f(int) -> int from Daniel Wallin! (With a few minor bug fixes from me). llvm-svn: 115322
* Allow the use of C++0x deleted functions as an extension in C++98.Anders Carlsson2010-09-241-1/+1
| | | | llvm-svn: 114762
* Implement __has_feature(cxx_inline_namespaces)Sebastian Redl2010-08-311-0/+1
| | | | llvm-svn: 112671
* Add support for Microsoft's __pragma in the preprocessor.John McCall2010-08-281-2/+10
| | | | | | Patch by Francois Pichet! llvm-svn: 112391
* Implement code completion for preprocessor expressions and in macroDouglas Gregor2010-08-241-0/+8
| | | | | | arguments. llvm-svn: 111976
* After a lengthy design discussion, add support for "ownership attributes" ↵Ted Kremenek2010-07-311-0/+3
| | | | | | for malloc/free checking. Patch by Andrew McGregor! llvm-svn: 109939
* More clang support for darwin tls. Add a __has_feature macro andEric Christopher2010-06-241-0/+2
| | | | | | target specific preprocessor define as well. llvm-svn: 106715
* Add '__has_feature' support for weak ObjC classes.Ted Kremenek2010-04-291-0/+1
| | | | llvm-svn: 102588
* Sort '__has_feature' cases. No functionality change.Ted Kremenek2010-04-291-15/+15
| | | | llvm-svn: 102587
* fix a case where macro expansion should be disabled, patch by Chris Lattner2010-03-261-4/+7
| | | | | | Abramo Bagnara! llvm-svn: 99626
* Audit all Preprocessor::getSpelling() callers, improving failureDouglas Gregor2010-03-161-2/+6
| | | | | | recovery for those that need it. llvm-svn: 98689
* Augment __has_feature to report that Clang supports adding attribute 'unused'Ted Kremenek2010-03-051-0/+1
| | | | | | to an Objective-C instance variable. llvm-svn: 97850
* Add an overload of Preprocessor::getSpelling which takes a SmallVector andBenjamin Kramer2010-02-271-6/+2
| | | | | | returns a StringRef. Use it to simplify some repetitive code. llvm-svn: 97322
* Add __has_feature support for attributes ns_returns_not_retainedTed Kremenek2010-02-181-1/+3
| | | | | | and cf_returns_not_retained. llvm-svn: 96538
* Use raw_ostreams in Preprocessor::ExpandBuiltinMacro. Still not nice but ↵Benjamin Kramer2010-01-271-19/+17
| | | | | | less fragile than the old code. llvm-svn: 94679
* Fix typo in commentDouglas Gregor2010-01-261-1/+1
| | | | llvm-svn: 94576
* revert my patch for rdar://7520940 that warns when a published headerChris Lattner2010-01-221-3/+1
| | | | | | | is #included with "foo.h" style syntax instead of framework syntax. It produced too much noise. llvm-svn: 94120
* Add a bunch more feature-checking macros for C++0x features. Some of these areAlexis Hunt2010-01-131-0/+10
| | | | | | | disabled with the intent that users can start with them now and not have to change a thing to have them work when we implement the features. llvm-svn: 93312
* stringref'ize a bunch of filename handling logic. MuchChris Lattner2010-01-101-11/+8
| | | | | | nicer than passing around two const char*'s. llvm-svn: 93094
* implement rdar://7520940: published framework headers shouldChris Lattner2010-01-101-1/+2
| | | | | | | import other headers within the same framework with the full framework path, not with a relative include. llvm-svn: 93083
* Simplify with StringSwitch.Benjamin Kramer2010-01-091-28/+12
| | | | llvm-svn: 93064
* move the VarargsElided member of MacrosArgs to shrink the MacroArgs structChris Lattner2009-12-141-3/+3
| | | | | | | on 64-bit targets. Pass Preprocessor into create/destroy methods of MacroArgs even though it isn't used yet. llvm-svn: 91345
* Get rid of some diagnostics that don't follow our rules for -pedanticEli Friedman2009-12-081-7/+0
| | | | | | | diagnostics (specifically, that any extension in a compiler-reserved namespace shouldn't trigger a diagnostic). llvm-svn: 90826
* Add 'has_feature(cxx_exceptions)' to allow code to determine via ↵Ted Kremenek2009-12-031-0/+3
| | | | | | preprocessor logic if C++ exceptions are enabled. llvm-svn: 90378
* Rename has_feature(rtti) to has_feature(cxx_rtti) for clarity.Ted Kremenek2009-12-031-3/+3
| | | | llvm-svn: 90376
* Add "has_feature" support for C++ RTTI.Ted Kremenek2009-12-031-0/+3
| | | | llvm-svn: 90368
* Added __has_include and __has_include_next.John Thompson2009-11-021-2/+129
| | | | llvm-svn: 85834
* PR4991: Properly remove trailing newline from __TIMESTAMP__.Benjamin Kramer2009-09-161-3/+3
| | | | | | Replace strcpy with memcpy while at it. llvm-svn: 82043
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-80/+80
| | | | llvm-svn: 81346
* Updated GNU runtime non-fragile ABI.David Chisnall2009-08-311-0/+3
| | | | | | | Added -fconstant-string-class= option. Added __has_feature() test for non-fragile ABI. llvm-svn: 80591
* implement and document a new __has_feature and __has_builtin magic Chris Lattner2009-06-131-13/+82
| | | | | | | | | builtin preprocessor macro. This appears to work with two caveats: 1) builtins are registered in -E mode, and 2) target-specific builtins are unconditionally registered even if they aren't supported by the target (e.g. SSE4 builtin when only SSE1 is enabled). llvm-svn: 73289
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-1/+2
| | | | llvm-svn: 72210
* When we expect two arguments but have zero, make sure to addChris Lattner2009-05-131-0/+5
| | | | | | | | | two empty arguments. Also, add an assert so that this bug manifests as an assertion failure, not a valgrind problem. This fixes rdar://6880648 - [cpp] crash in ArgNeedsPreexpansion llvm-svn: 71616
OpenPOWER on IntegriCloud