summaryrefslogtreecommitdiffstats
path: root/lib/Parse/ParseAST.cpp
Commit message (Collapse)AuthorAgeFilesLines
* C++ Modules TS: add frontend support for building pcm files from moduleRichard Smith2016-08-261-15/+7
| | | | | | | | interface files. At the moment, all declarations (and no macros) are exported, and 'export' declarations are not supported yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279794 91177308-0d34-0410-b5e6-96231b3b80d8
* C++ Modules TS: support parsing the 'module' declaration (including extensionsRichard Smith2016-08-191-1/+1
| | | | | | | | | from p0273r0 approved by EWG). We'll eventually need to handle this from the lexer as well, in order to disallow preprocessor directives preceding the module declaration and to support macro import. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279196 91177308-0d34-0410-b5e6-96231b3b80d8
* Prune four superfluous ExternalSemaSource.h includes and one forward ↵Yaron Keren2016-05-131-1/+0
| | | | | | | | | | declaration in Sema.h where ExternalSemaSource.h was already included due to ExternalSemaSource:: member uses. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269423 91177308-0d34-0410-b5e6-96231b3b80d8
* Restore PrettyStackTrace state on crash.Nico Weber2015-08-071-0/+17
| | | | | | | Last part of PR11974. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244339 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded include of DeclCXX.h from libParse.Nico Weber2014-12-281-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224893 91177308-0d34-0410-b5e6-96231b3b80d8
* Rangify for loop, NFC.Yaron Keren2014-12-171-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224434 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-121-1/+1
| | | | | | class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203641 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace OwningPtr include with <memory>.Ahmed Charles2014-03-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203389 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-3/+4
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203279 91177308-0d34-0410-b5e6-96231b3b80d8
* Use SmallVectorImpl instead of SmallVector for iterators and references to ↵Craig Topper2013-07-041-1/+1
| | | | | | avoid specifying the vector size unnecessarily. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185610 91177308-0d34-0410-b5e6-96231b3b80d8
* Try harder to be signal-safe inside our signal handler. The most prominent ↵Nick Lewycky2013-03-251-4/+15
| | | | | | | | | | | behavioural difference is that we no longer clean the token before emitting it. This fixes a bug where clang hangs in the middle of crashing because the crash handler calls malloc from inside a crash that happened inside of free. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177919 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix indent.Chad Rosier2012-12-211-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170918 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-5/+5
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
* Move PrettyStackTraceParserEntry to ParseAST.cppNico Weber2012-11-271-3/+35
| | | | | | | | | r128056 moved PrettyStackTraceParserEntry construction from Parser.h to ParseAST.cpp, so there's no need to keep this class in a header. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168731 91177308-0d34-0410-b5e6-96231b3b80d8
* Have the parser initialize Sema before it consumes the firstDouglas Gregor2012-11-051-1/+0
| | | | | | | | | token. This is important because the first token could actually be after an #include that triggers a module import, which might use either Sema or the AST consumer before it would have been initialized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167423 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop the ASTContext.h include from Stmt.h and fix up transitive users.Benjamin Kramer2012-07-041-0/+1
| | | | | | | | | | | | | | This required moving the ctors for IntegerLiteral and FloatingLiteral out of line which shouldn't change anything as they are usually called through Create methods that are already out of line. ASTContext::Deallocate has been a nop for a long time, drop it from ASTVector and make it independent from ASTContext.h Pass the StorageAllocator directly to AccessedEntity so it doesn't need to have a definition of ASTContext around. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159718 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert predefined decl tracking.Meador Inge2012-06-191-33/+11
| | | | | | | | | | | r158085 added some logic to track predefined declarations. The main reason we had predefined declarations in the input was because the __builtin_va_list declarations were injected into the preprocessor input. As of r158592 we explicitly build the __builtin_va_list declarations. Therefore the predefined decl tracking is no longer needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158732 91177308-0d34-0410-b5e6-96231b3b80d8
* Add pedantic warning -Wempty-translation-unit (C11 6.9p1).Jordan Rose2012-06-061-15/+39
| | | | | | | | | | | | | | | | | | | In standard C since C89, a 'translation-unit' is syntactically defined to have at least one "external-declaration", which is either a decl or a function definition. In Clang the latter gives us a declaration as well. The tricky bit about this warning is that our predefines can contain external declarations (__builtin_va_list and the 128-bit integer types). Therefore our AST parser now makes sure we have at least one declaration that doesn't come from the predefines buffer. Also, remove bogus warning about empty source files. This doesn't catch source files that only contain comments, and never fired anyway because of our predefines. PR12665 and <rdar://problem/9165548> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158085 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a flag to the parser to skip method bodies.Erik Verbruggen2012-04-121-6/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154584 91177308-0d34-0410-b5e6-96231b3b80d8
* AST/stats: Don't effectively use an out-of-line function to return a staticDaniel Dunbar2012-03-051-2/+2
| | | | | | bool. Ugh. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152062 91177308-0d34-0410-b5e6-96231b3b80d8
* Make parsing of objc @implementations more robust.Argyrios Kyrtzidis2012-02-071-4/+0
| | | | | | | | | | | | | | | | | | | Parsing of @implementations was based on modifying global state from the parser; the logic for late parsing of methods was spread in multiple places making it difficult to have a robust error recovery. -it was difficult to ensure that we don't neglect parsing the lexed methods. -it was difficult to setup the original objc container context for parsing the lexed methods after completing ParseObjCAtImplementationDeclaration and returning to top level context. Enhance parsing of @implementations by centralizing it in Parser::ParseObjCAtImplementationDeclaration(). ParseObjCAtImplementationDeclaration now returns only after an @implementation is fully parsed; all the data and logic for late parsing of methods is now in one place. This allows us to provide code-completion for late parsed methods with mis-matched braces. rdar://10775381 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149987 91177308-0d34-0410-b5e6-96231b3b80d8
* Basic: import OwningPtr<> into clang namespaceDylan Noblesmith2012-02-051-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149798 91177308-0d34-0410-b5e6-96231b3b80d8
* Change ASTConsumer::HandleTopLevelDecl to return true for the parser to continueArgyrios Kyrtzidis2011-11-181-2/+11
| | | | | | parsing or false to abort parsing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144943 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a -cc1 option "-emit-module", that creates a binary moduleDouglas Gregor2011-08-251-2/+2
| | | | | | | | | | | from the given source. -emit-module behaves similarly to -emit-pch, except that Sema is somewhat more strict about the contents of -emit-module. In the future, there are likely to be more interesting differences. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138595 91177308-0d34-0410-b5e6-96231b3b80d8
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-1/+1
| | | | | | | | | LLVM.h imports them into the clang namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
* Build up statistics about the work done for analysis based warnings.Chandler Carruth2011-07-061-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Special detail is added for uninitialized variable analysis as this has serious performance problems than need to be tracked. Computing some of this data is expensive, for example walking the CFG to determine its size. To avoid doing that unless the stats data is going to be used, we thread a bit into the Sema object to track whether detailed stats should be collected or not. This bit is used to avoid computations whereever the computations are likely to be more expensive than checking the state of the flag. Thus, counters are in some cases unconditionally updated, but the more expensive (and less frequent) aggregation steps are skipped. With this patch, we're able to see that for 'gcc.c': *** Analysis Based Warnings Stats: 232 functions analyzed (0 w/o CFGs). 7151 CFG blocks built. 30 average CFG blocks per function. 1167 max CFG blocks per function. 163 functions analyzed for uninitialiazed variables 640 variables analyzed. 3 average variables per function. 94 max variables per function. 96409 block visits. 591 average block visits per function. 61546 max block visits per function. And for the reduced testcase in PR10183: *** Analysis Based Warnings Stats: 98 functions analyzed (0 w/o CFGs). 8526 CFG blocks built. 87 average CFG blocks per function. 7277 max CFG blocks per function. 68 functions analyzed for uninitialiazed variables 1359 variables analyzed. 19 average variables per function. 1196 max variables per function. 2540494 block visits. 37360 average block visits per function. 2536495 max block visits per function. That last number is the somewhat scary one that indicates the problem in PR10183. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134494 91177308-0d34-0410-b5e6-96231b3b80d8
* Start switching the AST stats printing to use llvm::errs() instead ofChandler Carruth2011-07-041-1/+1
| | | | | | fprintf. There is more cleanup to be done to the AST stats printing... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134373 91177308-0d34-0410-b5e6-96231b3b80d8
* Migrate 'PrettySTackTraceParserEntry' object out of Parser, and have it ↵Ted Kremenek2011-03-221-4/+10
| | | | | | | | constructed within ParseAST. This avoids double crashes during crash recovery. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128056 91177308-0d34-0410-b5e6-96231b3b80d8
* Construct 'Sema' object on the stack, so that crash recovery can recovery ↵Ted Kremenek2011-03-181-3/+7
| | | | | | it's associated resources without walking over dead stack space. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127864 91177308-0d34-0410-b5e6-96231b3b80d8
* Use CrashRecoveryContextCleanup objects to release resources associated with ↵Ted Kremenek2011-03-181-0/+7
| | | | | | Sema during a crash while parsing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127850 91177308-0d34-0410-b5e6-96231b3b80d8
* The internal -fdump-record-layouts flag already dumps the layout when it was ↵Douglas Gregor2011-02-171-24/+0
| | | | | | computed; no need to do so again at the end of the translation unit git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125760 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove Sema.h's dependency on DeclCXX.h.John McCall2010-08-251-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112032 91177308-0d34-0410-b5e6-96231b3b80d8
* Push DeclGroupRefs and TemplateNames in an opaque but type-safe wayJohn McCall2010-08-231-2/+2
| | | | | | | | through the parser. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111800 91177308-0d34-0410-b5e6-96231b3b80d8
* Another step in the process of making the parser depend on Sema:John McCall2010-08-201-0/+113
- move DeclSpec &c into the Sema library - move ParseAST into the Parse library Reflect this change in a thousand different includes. Reflect this change in the link orders. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111667 91177308-0d34-0410-b5e6-96231b3b80d8