summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPMacroExpansion.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Advertise support for cxx_range_for as an extension in C++98 mode. Patch by ↵Richard Smith2011-09-061-0/+1
| | | | | | | | Jean-Daniel Dupas! Also provide a modicum of test coverage for ranged for in C++98. llvm-svn: 139149
* Add test case for defaulted copy and move structure validation.Sebastian Redl2011-09-041-1/+1
| | | | | | | | Fix bug this uncovered. Address minor comments from Doug. Enable cxx_implicit_moves feature. llvm-svn: 139101
* Support code-completion for C++ inline methods and ObjC buffering methods.Argyrios Kyrtzidis2011-09-041-23/+8
| | | | | | | | | | | | | | Previously we would cut off the source file buffer at the code-completion point; this impeded code-completion inside C++ inline methods and, recently, with buffering ObjC methods. Have the code-completion inserted into the source buffer so that it can be buffered along with a method body. When we actually hit the code-completion point the cut-off lexing or parsing. Fixes rdar://10056932&8319466 llvm-svn: 139086
* Don't try keeping a 'LeadingEmptyMacroLoc' in NullStmt. This failsArgyrios Kyrtzidis2011-09-011-1/+0
| | | | | | in the face of buffering C++/ObjC method bodies. llvm-svn: 138972
* Add and document __has_feature values for the remaining C++0xDouglas Gregor2011-08-291-0/+11
| | | | | | | features, so clients can check for the availability of these features even before we get around to implementing them. llvm-svn: 138741
* [libclang] Support code-completion inside macro arguments.Argyrios Kyrtzidis2011-08-181-1/+17
| | | | llvm-svn: 137973
* For the MacroExpands preprocessor callback, also pass the SourceRangeArgyrios Kyrtzidis2011-08-181-5/+7
| | | | | | of expansion (for function macros it includes the right paren). llvm-svn: 137909
* Add a __has_feature macro for generalized initializers, turned offAlexis Hunt2011-08-071-0/+1
| | | | | | because we don't support them yet. llvm-svn: 137027
* Comment the weird behavior of __has_feature(is_empty) and __has_feature(is_pod)Douglas Gregor2011-08-031-0/+8
| | | | llvm-svn: 136788
* Fix a thinko in my __is_empty/__is_pod commit.Douglas Gregor2011-07-301-2/+6
| | | | llvm-svn: 136561
* Turn off __has_feature(is_empty) and __has_feature(is_pod) if theDouglas Gregor2011-07-301-2/+4
| | | | | | | libstdc++ hack has reverted these type traits to keywords. Icky, but fixes <rdar://problem/9836262>. llvm-svn: 136560
* Rename create(MacroArg)InstantiationLoc to create(MacroArg)ExpansionLoc.Chandler Carruth2011-07-261-8/+8
| | | | llvm-svn: 136054
* Rename SourceManager::getInstantiationRange to getExpansionRange.Chandler Carruth2011-07-251-1/+1
| | | | llvm-svn: 135915
* Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon ↵Chris Lattner2011-07-231-1/+1
| | | | | | Mulder! llvm-svn: 135855
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-3/+3
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Remember to add a has_feature macro for __underlying_type now that it isAlexis Hunt2011-07-181-0/+1
| | | | | | correctly impelmented llvm-svn: 135401
* Move the rest of the preprocessor terminology from 'instantiate' andChandler Carruth2011-07-141-13/+13
| | | | | | | | | | | | | variants to 'expand'. This changed a couple of public APIs, including one public type "MacroInstantiation" which is now "MacroExpansion". The rest of the codebase was updated to reflect this, especially the libclang code. Two of the C++ (and thus easily changed) libclang APIs were updated as well because they pertained directly to the old MacroInstantiation class. No functionality changed. llvm-svn: 135139
* Change the driver's logic about Objective-C runtimes: abstract out aJohn McCall2011-07-061-1/+1
| | | | | | | | | | | | structure to hold inferred information, then propagate each invididual bit down to -cc1. Separate the bits of "supports weak" and "has a native ARC runtime"; make the latter a CodeGenOption. The tool chain is still driving this decision, because it's the place that has the required deployment target information on Darwin, but at least it's better-factored now. llvm-svn: 134453
* Introduce a caching mechanism for macro expanded tokens.Argyrios Kyrtzidis2011-06-291-0/+41
| | | | | | | | | | | | | | | Previously macro expanded tokens were added to Preprocessor's bump allocator and never released, even after the TokenLexer that were lexing them was finished, thus they were wasting memory. A very "useful" boost library was causing clang to eat 1 GB just for the expanded macro tokens. Introduce a special cache that works like a stack; a TokenLexer can add the macro expanded tokens in the cache, and when it finishes, the tokens are removed from the end of the cache. Now consumed memory by expanded tokens for that library is ~ 1.5 MB. Part of rdar://9327049. llvm-svn: 134105
* Automatic Reference Counting.John McCall2011-06-151-0/+5
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Audit and finish the implementation of C++0x nullptr, fixing twoDouglas Gregor2011-05-211-1/+1
| | | | | | | | | | | | | | minor issues along the way: - Non-type template parameters of type 'std::nullptr_t' were not permitted. - We didn't properly introduce built-in operators for nullptr ==, !=, <, <=, >=, or > as candidate functions . To my knowledge, there's only one (minor but annoying) part of nullptr that hasn't been implemented: catching a thrown 'nullptr' as a pointer or pointer-to-member, per C++0x [except.handle]p4. llvm-svn: 131813
* Revert r131672 until __underlying_type is properly implemented in theAlexis Hunt2011-05-191-1/+0
| | | | | | template case. llvm-svn: 131692
* Implement a __has_feature for __underlying_typeAlexis Hunt2011-05-191-0/+1
| | | | llvm-svn: 131672
* Introduce __has_extension macroPeter Collingbourne2011-05-131-6/+41
| | | | | | | | | | | | | | | __has_extension is a function-like macro which takes the same set of feature identifiers as __has_feature. It evaluates to 1 if the feature is supported by Clang in the current language (either as a language extension or a standard language feature) or 0 if not. At the same time, add support for the C1X feature identifiers c_generic_selections (renamed from generic_selections) and c_static_assert, and document them. Patch by myself and Jean-Daniel Dupas. llvm-svn: 131308
* Implement the __is_trivially_copyable type traitAlexis Hunt2011-05-131-0/+1
| | | | llvm-svn: 131270
* enable __has_feature(is_standard_layout)Howard Hinnant2011-05-121-0/+1
| | | | llvm-svn: 131240
* Implement CWG1170, which makes access-control errors into templateDouglas Gregor2011-05-111-0/+1
| | | | | | | argument deduction failures. Only implemented in C++0x, since this is a significant change in behavior from C++98/03. llvm-svn: 131209
* Implement support for C++0x alias templates.Richard Smith2011-05-051-0/+1
| | | | llvm-svn: 130953
* Fully implement delegating constructors!Alexis Hunt2011-05-011-0/+1
| | | | | | | | | | As far as I know, this implementation is complete but might be missing a few optimizations. Exceptions and virtual bases are handled correctly. Because I'm an optimist, the web page has appropriately been updated. If I'm wrong, feel free to downgrade its support categories. llvm-svn: 130642
* Only call the MacroExpands callback when we're actually going toDouglas Gregor2011-04-281-2/+3
| | | | | | expand the macro, based on a patch by Ori Avtalion. Fixes PR9799. llvm-svn: 130402
* If a null statement was preceded by an empty macro keep its instantiation ↵Argyrios Kyrtzidis2011-04-271-3/+4
| | | | | | | | source location in NullStmt. llvm-svn: 130289
* To be able to replay compilations we need to accurately remodel howManuel Klimek2011-04-261-1/+1
| | | | | | | | | includes get resolved, especially when they are found relatively to another include file. We also try to get it working for framework includes, but that part of the code is untested, as I don't have a code base that uses it. llvm-svn: 130246
* Implement basic __is_trivial type-trait support, enough to close PR9472.Chandler Carruth2011-04-231-0/+1
| | | | | | | | | | | | | | | | | | This introduces a few APIs on the AST to bundle up the standard-based logic so that programmatic clients have access to exactly the same behavior. There is only one serious FIXME here: checking for non-trivial move constructors and move assignment operators. Those bits need to be added to the declaration and accessors provided. This implementation should be enough for the uses of __is_trivial in libstdc++ 4.6's C++98 library implementation. Ideas for more thorough test cases or any edge cases missing would be appreciated. =D llvm-svn: 130057
* Sort the type traits in a few places where they weren't previouslyChandler Carruth2011-04-231-1/+1
| | | | | | sorted in order to prepare for adding some new ones. llvm-svn: 130056
* don't warn about empty macro arguments in c++'0x mode, since it sucked inChris Lattner2011-04-221-2/+2
| | | | | | the c99 preprocessor. Patch by Jonathan Sauer! llvm-svn: 130031
* Add __has_feature(cxx_range_for) check for C++11 range-based for loop.Richard Smith2011-04-151-0/+1
| | | | llvm-svn: 129573
* C1X: implement generic selectionsPeter Collingbourne2011-04-151-0/+1
| | | | | | | As an extension, generic selection support has been added for all supported languages. The syntax is the same as for C1X. llvm-svn: 129554
* Add a __has_feature check for the 'availability' attributeDouglas Gregor2011-03-261-0/+1
| | | | llvm-svn: 128337
* we can now claim to fully support the override control feature in C++0x.Anders Carlsson2011-03-251-0/+1
| | | | llvm-svn: 128281
* Add a 'RawPath' parameter to the PPCallbacks interface. This allowsChandler Carruth2011-03-161-1/+2
| | | | | | | | | | | | | | | clients to observe the exact path through which an #included file was located. This is very useful when trying to record and replay inclusion operations without it beind influenced by the aggressive caching done inside the FileManager to avoid redundant system calls and filesystem operations. The work to compute and return this is only done in the presence of callbacks, so it should have no effect on normal compilation. Patch by Manuel Klimek. llvm-svn: 127742
* Create __has_feature(cxx_noexcept) and mark it as working.Sebastian Redl2011-03-151-0/+1
| | | | | | | Find out that our C++0x status has only one field for noexcept expression and specification together, and that it was accidentally already marked as fully implemented. This completes noexcept specification work. llvm-svn: 127701
* Provide an attribute, objc_method_family, to allow the inferred familyJohn McCall2011-03-021-0/+1
| | | | | | | | | | of an Objective-C method to be overridden on a case-by-case basis. This is a higher-level tool than ns_returns_retained &c.; it lets users specify that not only does a method have different retain/release semantics, but that it semantically acts differently than one might assume from its name. This in turn is quite useful to static analysis. llvm-svn: 126839
* Rename tok::eom to tok::eod.Peter Collingbourne2011-02-281-5/+5
| | | | | | | | The previous name was inaccurate as this token in fact appears at the end of every preprocessing directive, not just macro definitions. No functionality change, except for a diagnostic tweak. llvm-svn: 126631
* Turn on __has_feature(cxx_auto_type). The feature is now fully implemented.Richard Smith2011-02-201-1/+1
| | | | llvm-svn: 126078
* Add a __has_feature check for default template arguments in functionDouglas Gregor2011-02-051-0/+1
| | | | | | templates, a C++0x feature. llvm-svn: 124973
* Add __has_feature() for each of the type traitsDouglas Gregor2011-02-031-0/+19
| | | | llvm-svn: 124820
* Wire up attributes 'ns_consumed' and 'cf_consumed' in the static analyzer's ↵Ted Kremenek2011-01-271-0/+2
| | | | | | ObjC retain/release checker. llvm-svn: 124386
* Hook up attribute ns_consumes_self in the ObjC retain/release checker in the ↵Ted Kremenek2011-01-271-0/+1
| | | | | | static analyzer. llvm-svn: 124360
* Add __has_feature(cxx_reference_qualified_functions); update tests andDouglas Gregor2011-01-261-0/+1
| | | | | | documentation. llvm-svn: 124322
* Clean up the C++0x __has_feature tests. Specifically:Douglas Gregor2011-01-261-10/+11
| | | | | | | | | | | | | - Don't publicize a C++0x feature through __has_feature if we aren't in C++0x mode (even if the feature is available only with a warning). - "auto" is not implemented well enough for its __has_feature to be turned on. - Fix the test of C++0x __has_feature to actually test what we're trying to test. Searching for the substring "foo" when our options are "foo" and "no_foo" doesn't work :) llvm-svn: 124291
OpenPOWER on IntegriCloud