summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
* Serialize TargetOptions into an AST file, and make sure that we keepDouglas Gregor2012-10-162-28/+18
| | | | | | | target options around so they can be accessed at any point (rather than keeping them transient). llvm-svn: 166072
* Teach TargetInfo to hold on to the TargetOptions with which it wasDouglas Gregor2012-10-151-4/+6
| | | | | | created. llvm-svn: 165943
* Make sure temporary files are deleted when recovering from a crash when ↵Benjamin Kramer2012-10-141-0/+1
| | | | | | compiling modules. llvm-svn: 165911
* Delete temporary output files when an error occurs during PCH reading.Benjamin Kramer2012-10-142-0/+2
| | | | | | | | This reduces the spam make test leaves behind in /tmp. The assert isn't particularly useful because it's not run with -disable-free (the default when using the clang driver) but should cover all -cc1 tests. llvm-svn: 165910
* [libclang] Improve AST serialization done by ASTUnit::Save().Argyrios Kyrtzidis2012-10-111-28/+64
| | | | | | | | | The ASTUnit needs to initialize an ASTWriter at the beginning of parsing to fully handle serialization of a translation unit that imports modules. Do this by introducing an option to enable it, which corresponds to CXTranslationUnit_ForSerialization on the C API side. llvm-svn: 165717
* When indexing a module file, for the ppIncludedFile callback giveArgyrios Kyrtzidis2012-10-101-5/+11
| | | | | | | an invalid location if the location points to the synthetic buffer for the module input. llvm-svn: 165592
* [modules] Consistently construct a buffer as input to build the module.Argyrios Kyrtzidis2012-10-101-82/+42
| | | | | | This means the main file for modules will always be a virtual one. llvm-svn: 165591
* Rework the (de-)serialization of macros, as stored inDouglas Gregor2012-10-093-1/+7
| | | | | | | | | | | | | | | | MacroInfo*. Instead of simply dumping an offset into the current file, give each macro definition a proper ID with all of the standard modules-remapping facilities. Additionally, when a macro is modified in a subsequent AST file (e.g., #undef'ing a macro loaded from another module or from a precompiled header), provide a macro update record rather than rewriting the entire macro definition. This gives us greater consistency with the way we handle declarations, and ties together macro definitions much more cleanly. Note that we're still not actually deserializing macro history (we never were), but it's far easy to do properly now. llvm-svn: 165560
* Don't emit double parentheses in __clang_version__.Benjamin Kramer2012-10-081-2/+2
| | | | | | PR14040. llvm-svn: 165415
* [Modules] Introduce Module::TopHeaders which is a set of top-level headersArgyrios Kyrtzidis2012-10-051-3/+8
| | | | | | that are associated with a (sub)module. llvm-svn: 165279
* [libclang] When indexing, invoke the importedASTFile for PCH files as well.Argyrios Kyrtzidis2012-10-031-0/+36
| | | | llvm-svn: 165161
* Introduce ASTConsumer::HandleImplicitImportDecl() callback that is invokedArgyrios Kyrtzidis2012-10-031-3/+6
| | | | | | when an ImportDecl that was implicitly created due to an inclusion directive. llvm-svn: 165084
* Some renames to use the 'visitor' nomenclature, no functionality change.Argyrios Kyrtzidis2012-10-031-1/+1
| | | | llvm-svn: 165083
* [libclang] When indexing an AST file, only deserialize the file levelArgyrios Kyrtzidis2012-10-021-0/+24
| | | | | | declarations of the current primary module. llvm-svn: 165046
* [libclang] When indexing an AST file, only deserialize the preprocessing recordArgyrios Kyrtzidis2012-10-021-0/+15
| | | | | | entities of the current primary module. llvm-svn: 165023
* For PPCallbacks::InclusionDirective() add a parameter for the module, wheneverArgyrios Kyrtzidis2012-09-292-4/+8
| | | | | | | an inclusion directive was automatically turned into a module import, and PPCallbacks::moduleImport() for an explicit module import. llvm-svn: 164874
* In the Module class, add a reference to the corresponding AST file.Argyrios Kyrtzidis2012-09-291-0/+3
| | | | llvm-svn: 164873
* Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. ↵Sylvestre Ledru2012-09-271-1/+1
| | | | | | See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164766 llvm-svn: 164769
* Fix a typo 'iff' => 'if'Sylvestre Ledru2012-09-271-1/+1
| | | | llvm-svn: 164766
* Per discussion in ↵Argyrios Kyrtzidis2012-09-272-4/+4
| | | | | | | | | | http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120917/064551.html have PPCallbacks::InclusionDirective pass the character range for the filename quotes or brackets. rdar://11113134 & http://llvm.org/PR13880 llvm-svn: 164743
* [libclang] Always report a CXCursor_MacroDefinition for code-completionArgyrios Kyrtzidis2012-09-271-3/+1
| | | | | | results for a macro name, not CXCursor_NotImplemented. llvm-svn: 164740
* Have ASTUnit::Save() return a bool to indicate save error.Argyrios Kyrtzidis2012-09-261-5/+5
| | | | | | Removes a dependency of ASTUnit to clang-c/Index.h. llvm-svn: 164704
* Allow disabling PCH validation when loading an AST file by checkingArgyrios Kyrtzidis2012-09-151-1/+4
| | | | | | an environment variable for debugging purposes. llvm-svn: 163958
* [libclang] When loading an AST file, make sure to apply the language optionsArgyrios Kyrtzidis2012-09-141-0/+15
| | | | | | | | to the target info. Related to rdar://12069503. llvm-svn: 163931
* Make TextDiagnostic more robust against SourceLocations which point into theRichard Smith2012-09-131-25/+54
| | | | | | | middle of UTF-8 characters, and avoid walking to such positions when adjusting column ranges for display. Fixes a couple of hangs when rendering diagnostics. llvm-svn: 163820
* Conditionally parse documentation comments in system headers byTed Kremenek2012-09-131-0/+3
| | | | | | | | | | passing -fretain-comments-from-system-headers. By default, the compiler no longer parses such documentation comments, as they can result in a noticeable compile time/PCH slowdown. Fixes <rdar://problem/11860820>. llvm-svn: 163778
* InitHeaderSearch.cpp: [mingw] Handle DOSish paths only on Win32 hosts.NAKAMURA Takumi2012-09-131-0/+4
| | | | llvm-svn: 163776
* [analyzer] Always include destructors in the analysis CFG.Jordan Rose2012-09-051-1/+0
| | | | | | | | | | | | | | | | | | | | | While destructors will continue to not be inlined (unless the analyzer config option 'c++-inlining' is set to 'destructors'), leaving them out of the CFG is an incomplete model of the behavior of an object, and can cause false positive warnings (like PR13751, now working). Destructors for temporaries are still not on by default, since (a) we haven't actually checked this code to be sure it's fully correct (in particular, we probably need to be very careful with regard to lifetime-extension when a temporary is bound to a reference, C++11 [class.temporary]p5), and (b) ExprEngine doesn't actually do anything when it sees a temporary destructor in the CFG -- not even invalidate the object region. To enable temporary destructors, set the 'cfg-temporary-dtors' analyzer config option to '1'. The old -cfg-add-implicit-dtors cc1 option, which controlled all implicit destructors, has been removed. llvm-svn: 163264
* Allow disabling of wchar_t type.Abramo Bagnara2012-09-052-3/+11
| | | | llvm-svn: 163221
* Make AnalyzerOptions a shared object between CompilerInvocation andTed Kremenek2012-08-311-2/+2
| | | | | | | AnalysisManager, allowing the StringMap of configuration values to be propagated. llvm-svn: 162978
* Move AnalyzerOptions.h into 'Core' StaticAnalyzer sub-library.Ted Kremenek2012-08-311-12/+12
| | | | llvm-svn: 162977
* [analyzer] Make analyzer-ipa=dynamic-bifurcate the default.Anna Zaks2012-08-301-1/+1
| | | | | | | There are two tests regressions that come from the fact that the Retain Count checker does not cancel out inlining of ObjC methods. llvm-svn: 162950
* Rename 'MaxLoop' to 'maxBlockVisitOnPath' to reflect reality. WeTed Kremenek2012-08-301-1/+1
| | | | | | should consider renaming the command line option as well. llvm-svn: 162932
* Rename 'VisualizeEGUbi' and 'VisualizeEGDot' to ↵Ted Kremenek2012-08-301-4/+6
| | | | | | | | 'visualizeExplodedGraphWithUbigGraph' and 'visualizeExplodedGraphWithGraphViz' respectively. llvm-svn: 162931
* Rename AnalyzerOptions 'EagerlyAssume' to 'eagerlyAssumeBinOpBifurcation'.Ted Kremenek2012-08-301-2/+2
| | | | llvm-svn: 162930
* Store const& to AnalyzerOptions in AnalysisManager instead of copyingTed Kremenek2012-08-301-1/+1
| | | | | | individual flags. llvm-svn: 162929
* Move Analyses.def to include/clang/StaticAnalyzer.Ted Kremenek2012-08-301-12/+12
| | | | llvm-svn: 162927
* Change -analyzer-config to use '=' as the key-value separator, and onlyTed Kremenek2012-08-301-3/+3
| | | | | | support the '-analyzer-config key=val' variant. llvm-svn: 162891
* Add new -cc1 driver option -analyzer-config, which allows one to specifyTed Kremenek2012-08-291-0/+30
| | | | | | | | | a comma separated collection of key:value pairs (which are strings). This allows a general way to provide analyzer configuration data from the command line. No clients yet. llvm-svn: 162827
* Keep history of macro definitions and #undefsAlexander Kornienko2012-08-291-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Summary: Keep history of macro definitions and #undefs with corresponding source locations, so that we can later find out all macros active in a specified source location. We don't save the history in PCH (no need currently). Memory overhead is about sizeof(void*)*3*<number of macro definitions and #undefs>+<in-memory size of all #undef'd macros> I've run a test on a file composed of 109 .h files from boost 1.49 on x86-64 linux. Stats before this patch: *** Preprocessor Stats: 73222 directives found: 19171 #define. 4345 #undef. #include/#include_next/#import: 5233 source files entered. 27 max include stack depth 19210 #if/#ifndef/#ifdef. 2384 #else/#elif. 6891 #endif. 408 #pragma. 14466 #if/#ifndef#ifdef regions skipped 80023/451669/1270 obj/fn/builtin macros expanded, 85724 on the fast path. 127145 token paste (##) operations performed, 11008 on the fast path. Preprocessor Memory: 5874615B total BumpPtr: 4399104 Macro Expanded Tokens: 417768 Predefines Buffer: 8135 Macros: 1048576 #pragma push_macro Info: 0 Poison Reasons: 1024 Comment Handlers: 8 Stats with this patch: ... Preprocessor Memory: 7541687B total BumpPtr: 6066176 Macro Expanded Tokens: 417768 Predefines Buffer: 8135 Macros: 1048576 #pragma push_macro Info: 0 Poison Reasons: 1024 Comment Handlers: 8 In my test increase in memory usage is about 1.7Mb, which is ~28% of initial preprocessor's memory usage and about 0.8% of clang's total VMM allocation. As for CPU overhead, it should only be noticeable when iterating over all macros, and should mostly consist of couple extra dereferences and one comparison per macro + skipping of #undef'd macros. It's less trivial to measure, though, as the preprocessor consumes a very small fraction of compilation time. Reviewers: doug.gregor, klimek, rsmith, djasper Reviewed By: doug.gregor CC: cfe-commits, chandlerc Differential Revision: http://llvm-reviews.chandlerc.com/D28 llvm-svn: 162810
* _HAS_CHAR16_T_LANGUAGE_SUPPORT is not predefined MSVC macro.Francois Pichet2012-08-251-4/+0
| | | | llvm-svn: 162641
* [ms-inline asm] Change the -fenable-experimental-ms-inline-asm option from a Chad Rosier2012-08-241-1/+2
| | | | | | | | | CodeGen option to a LangOpt option. In turn, hoist the guard into the parser so that we avoid the new (and fairly unstable) Sema/AST/CodeGen logic. This should restore the behavior of clang to that prior to r158325. <rdar://problem/12163681> llvm-svn: 162602
* [analyzer] Set the default IPA mode to 'basic-inlining', which excludes C++.Jordan Rose2012-08-211-1/+1
| | | | | | | | | | | | | | | | | | | Under -analyzer-ipa=basic-inlining, only C functions, blocks, and C++ static member functions are inlined -- essentially, the calls that behave like simple C function calls. This is essentially the behavior in Xcode 4.4. C++ support still has some rough edges, and we don't want users to be worried about them if they download and run their own checker. (In particular, the massive number of false positives for analyzing LLVM comes from inlining defensively-written code in contexts where more aggressive assumptions are implicitly made. This problem is not unique to C++, but it is exacerbated by the higher proportion of code that lives in header files in C++.) The eventual goal is to be comfortable enough with C++ support (and simple Objective-C support) to advance to -analyzer-ipa=inlining as the default behavior. See the IPA design notes for more details. llvm-svn: 162318
* [driver] Add support for the --param ssp-buffer-size= driver option.Chad Rosier2012-08-211-0/+2
| | | | | | PR9673 llvm-svn: 162285
* Avoid binding a reference to a dereferenced pointer in diagnostic serializationRichard Smith2012-08-211-92/+133
| | | | | | | | | | | if a diagnostic is emitted outside of any source file. The fix mirrors the corresponding code in TextDiagnosticPrinter. This required moving the functional parts of SDiagRenderer into SDiagWriter so they can be reused in the non-rendering codepath. No functionality change. llvm-svn: 162253
* Screw around with ObjCRuntime some more, changing theJohn McCall2012-08-212-8/+10
| | | | | | | | diagnostics for bad deployment targets and adding a few more predicates. Includes a patch by Jonathan Schleifer to enable ARC for ObjFW. llvm-svn: 162252
* Allow -verify to be used with files that don't have an associated FileEntry.Jordan Rose2012-08-181-43/+115
| | | | | | | | | | | | | | | | | | In Debug builds, VerifyDiagnosticConsumer checks any files with diagnostics to make sure we got the chance to parse them for directives (expected-warning and friends). This check previously relied on every parsed file having a FileEntry, which broke the cling interpreter's test suite. This commit changes the extra debug checking to mark a file as unparsed as soon as we see a diagnostic from that file. At the very end, any files that are still marked as unparsed are checked for directives, and a fatal error is emitted (as before) if we find out that there were directives we missed. -verify directives should always live in actual parsed files, not in PCH or AST files. Patch by Andy Gibbs, with slight modifications by me. llvm-svn: 162171
* Fixed crash and added a test and a minor output problemAlexander Kornienko2012-08-171-2/+3
| | | | llvm-svn: 162110
* Switch PTH format from a 7 byte magic number to an 8 byte one, to avoidRichard Smith2012-08-171-1/+1
| | | | | | misaligned reads throughout the file. Bump PTH format version to 10. llvm-svn: 162076
* Fix base type of ASTDeclNodeLister.Michael Han2012-08-151-1/+1
| | | | llvm-svn: 161963
OpenPOWER on IntegriCloud