summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Fix undefined behavior in code completion, caught byRichard Smith2012-08-141-66/+66
| | | | | | | -fcatch-undefined-behavior. Don't try to fit 34 different flags into 32 bits. Also, don't use 32-bit signed left shifts for this. llvm-svn: 161830
* Frontend: define _LP64 in a target-independent wayDylan Noblesmith2012-08-101-0/+7
| | | | | | | | | | | | | | Instead of adding it to each individual subclass in Targets.cpp, simply check the appropriate target values. Where before it was only on x86_64 and ppc64, it's now also defined on mips64 and nvptx64. Also add a bunch of negative tests to ensure it is *not* defined on any other architectures while we're here. llvm-svn: 161685
* Add missing cctype includes.Joerg Sonnenberger2012-08-104-0/+4
| | | | llvm-svn: 161660
* Update VerifyDiagnosticConsumer to only get directives during parsing.Jordan Rose2012-08-101-40/+100
| | | | | | | | | | | | | | | | | | | | The old behavior was to re-scan any files (like modules) where we may have directives but won't actually be parsing during the -verify invocation. Now, we keep the old behavior in Debug builds as a sanity check (though modules are a known entity), and expect all legitimate directives to come from comments seen by the preprocessor. This also affects the ARC migration tool, which captures diagnostics in order to filter some out. This change adds an explicit cleanup to CaptureDiagnosticsConsumer in order to let its sub-consumer handle the real end of diagnostics. This was originally split into four patches, but the tests do not run cleanly without all four, so I've combined them into one commit. Patches by Andy Gibbs, with slight modifications from me. llvm-svn: 161650
* Make sure to call EndSourceFile even if we can't continue compiling.Jordan Rose2012-08-101-1/+5
| | | | | | Patch by Andy Gibbs! llvm-svn: 161649
* clang support for Bitrig (an OpenBSD fork); patch by David Hill.Eli Friedman2012-08-081-0/+1
| | | | llvm-svn: 161546
* Preprocessor: fix __OPTIMIZE_SIZE__ and -OzDylan Noblesmith2012-08-081-2/+3
| | | | | | | | | | | | Add some tests for __OPTIMIZE_SIZE__ and __NO_INLINE__, removing the superfluous copies in the target-specific tests, since it's target-independent. This uncovered a bug in the handling of -Oz: it would attempt to store the value 2 in the 1-bit bitfield OptimizeSize, leaving a value of 0 and never defining __OPTIMIZE_SIZE__. llvm-svn: 161495
* Frontend: further document __BYTE_ORDER__Dylan Noblesmith2012-08-081-1/+3
| | | | llvm-svn: 161494
* Remove unused variables.Benjamin Kramer2012-08-081-7/+0
| | | | llvm-svn: 161483
* Correct AddDefaultCIncludePaths for OpenBSD to not include /usr/local/includeHans Wennborg2012-08-021-0/+1
| | | | | | | | | in the default search path. Compilers on *BSD OS's only include /usr/include by default. Contributed by Brad Smith <brad@comstyle.com> llvm-svn: 161173
* [analyzer] Turn -cfg-add-initializers on by default, and remove the flag.Jordan Rose2012-07-311-1/+0
| | | | llvm-svn: 161060
* Added -ast-list option to dump filterable AST decl node names.Alexander Kornienko2012-07-313-0/+35
| | | | llvm-svn: 161040
* Preprocessor: add __BYTE_ORDER__ predefined macroDylan Noblesmith2012-07-271-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | The __BYTE_ORDER__ predefined macro was added in GCC 4.6: http://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html It's used like the following: #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ... #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ... #else #error insane architecture like the pdp-11 #endif There's a similar macro, __FLOAT_WORD_ORDER__, but it looks like it mainly exist to accommodate fairly obscure architectures and ARM's old FPA instructions, so it doesn't seem nearly as useful. The tests are updated to check for the correct(at least, based on clang's current output) value of the macro on each target. So now the suite will catch bugs like the one fixed in r157626. llvm-svn: 160879
* clang/lib: [CMake] Update tblgen'd dependencies.NAKAMURA Takumi2012-07-271-0/+4
| | | | llvm-svn: 160851
* clang/lib: [CMake] Reformat, alphabetize lists.NAKAMURA Takumi2012-07-271-2/+2
| | | | llvm-svn: 160850
* Added -ast-dump-filter option to clang -cc1.Alexander Kornienko2012-07-263-19/+64
| | | | llvm-svn: 160784
* Fix a typo (the the => the)Sylvestre Ledru2012-07-232-2/+2
| | | | llvm-svn: 160622
* Rename -fms-inline-asm to -fenable-experimental-ms-inline-asm.Chad Rosier2012-07-201-1/+1
| | | | llvm-svn: 160590
* Add the mechanics for -fms-inline-asm. No easy way to test at this time.Chad Rosier2012-07-201-0/+1
| | | | llvm-svn: 160580
* Re-apply r160319 "Don't crash when emitting fixits following Unicode chars"Jordan Rose2012-07-201-29/+29
| | | | | | | | | This time, make sure we don't try to print fixits with newline characters, since they don't have a valid column width, and they don't look good anyway. PR13417 (and originally <rdar://problem/11877454>) llvm-svn: 160561
* Revert r160319, it caused PR13417. Add a test for PR13417.Nico Weber2012-07-201-26/+27
| | | | llvm-svn: 160542
* Define __FINITE_MATH_ONLY__ based on -ffast-math and -ffinite-math-only.Bob Wilson2012-07-192-3/+5
| | | | | | | This macro was being unconditionally set to zero, preceded by a FIXME comment. This fixes <rdar://problem/11845441>. Patch by Michael Gottesman! llvm-svn: 160491
* Don't crash when emitting fixits following Unicode characters.Jordan Rose2012-07-161-27/+26
| | | | | | | | | | | | | | | This code is very sensitive to the difference between "columns" as printed and "bytes" (SourceManager columns). All variables are now named explicitly and our assumptions are (hopefully) documented as both comment and assertion. Whether parseable fixits should use byte offsets or Unicode character counts is pending discussion on the mailing list; currently the implementation uses bytes (and has no problems on lines containing multibyte characters). This has been added to the user manual. <rdar://problem/11877454> llvm-svn: 160319
* PR13312: Don't crash when printing a fixit that ends in a unicode character.Benjamin Kramer2012-07-121-1/+6
| | | | llvm-svn: 160112
* Add OpenCL metadata for kernel arg names. This output is controlled via a ↵Tanya Lattner2012-07-111-0/+3
| | | | | | | | flag as noted in the OpenCL Spec. Includes a test case. llvm-svn: 160092
* Introduce a flag in SourceManager to treat non-system source filesArgyrios Kyrtzidis2012-07-111-8/+20
| | | | | | | | | | | | | | | | | | | | as "volatile", meaning there's a high enough chance that they may change while we are trying to use them. This flag is only enabled by libclang. Currently "volatile" source files will be stat'ed immediately before opening them, because the file size stat info may not be accurate since when we got it (e.g. from the PCH). This avoids crashes when trying to reference mmap'ed memory from a file whose size is not what we expect. Note that there's still a window for a racing issue to occur but the window for it should be way smaller than before. We can consider later on to avoid mmap completely on such files. rdar://11612916 llvm-svn: 160074
OpenPOWER on IntegriCloud