summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* -Rename -Wargument-larger-than -> -Wlarge-by-value-copyArgyrios Kyrtzidis2010-11-181-1/+1
| | | | | | | | | -Improve the diagnostic message -Add some comments Suggestions by Chris. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119594 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce option -Wargument-larger-than[=N] which warns about function ↵Argyrios Kyrtzidis2010-11-171-0/+2
| | | | | | | | | | definitions if they take by-value or return by-value any POD that is larger than some threshold (default is 64 bytes). Implements rdar://8548050. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119583 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement -working-directory.Argyrios Kyrtzidis2010-11-031-2/+26
| | | | | | | | | | | | | | | | | | | When -working-directory is passed in command line, file paths are resolved relative to the specified directory. This helps both when using libclang (where we can't require the user to actually change the working directory) and to help reproduce test cases when the reproduction work comes along. --FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains the working directory value if set). --FileSystemOptions are passed around to various interfaces that perform file operations. --Opening & reading the content of files should be done only through FileManager. This is useful in general since file operations will be abstracted in the future for the reproduction mechanism. FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same FileManager but with different FileSystemOptions. Addresses rdar://8583824. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118203 91177308-0d34-0410-b5e6-96231b3b80d8
* Substantially revise how clang computes the visibility of a declaration toJohn McCall2010-10-221-6/+6
| | | | | | | | | | more closely parallel the computation of linkage. This gets us to a state much closer to what gcc emits, modulo bugs, which will undoubtedly arise in abundance. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117147 91177308-0d34-0410-b5e6-96231b3b80d8
* Reorganize predefined macros for all Windows targets.Michael J. Spencer2010-10-211-0/+3
| | | | | | | | | | This adds an option to set the _MSC_VER macro without recompiling. This is very useful when testing compatibility with the Windows SDK and c++stdlib headers. -fmsc-version=<version> (defaults to VS2003 (1300)) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116999 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Whitespace.Michael J. Spencer2010-10-211-13/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116990 91177308-0d34-0410-b5e6-96231b3b80d8
* "Fix" bogus idempotent operations warning due to loop unrolling not ↵Ted Kremenek2010-10-181-1/+1
| | | | | | | | | | unrolling enough loops to show that an invariant doesn't hold. This fix is to increase the loop unrolling count to 4, which experiments show doesn't typically impact analysis time. The real fix is to modify the IdempotentOperationsChecker to suppress warnings where an analysis point could be preceded by a point where we gave up due to loop unrolling. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116769 91177308-0d34-0410-b5e6-96231b3b80d8
* Wire up the -fstrict-aliasing and -fno-strict-aliasing optionsDan Gohman2010-10-141-0/+1
| | | | | | | to CodeGenOption flags. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116530 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce command line option -error-on-deserialized-decl that is ↵Argyrios Kyrtzidis2010-10-141-0/+6
| | | | | | | | | | accompanied by a name and emits an error if a declaration with this name is deserialized from PCH. This is for testing, to make sure that we don't deserialize stuff needlessly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116505 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce command line option -dump-deserialized-decls which is used to ↵Argyrios Kyrtzidis2010-10-141-0/+1
| | | | | | print the PCH decls that got deserialized, for testing purposes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116503 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the (de-)serialization of code completion results, now thatDouglas Gregor2010-10-111-4/+0
| | | | | | | libclang does not support out-of-process code completion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116253 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate -fdiagnostics-binary and all of the infrastructure forDouglas Gregor2010-10-111-3/+0
| | | | | | | | | emitting diagnostics in a binary form to be consumed by libclang, since libclang no longer does any of its work out-of-process, making this code dead. Besides, this stuff never worked at 100% anyway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116250 91177308-0d34-0410-b5e6-96231b3b80d8
* Declare argv parameters as const char* const* instead of to char** to ↵Axel Naumann2010-10-111-2/+2
| | | | | | clarify that they are not modified, and to allow for string literals as arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116200 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement -fshort-enums (rdar://8490496).Argyrios Kyrtzidis2010-10-081-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116020 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce -flimit-debug-info.Devang Patel2010-09-301-0/+1
| | | | | | | In this experimental mode try avoiding debug info emission for classes as much as possible. The goal is to reduce size of produced debuginfo without reducing quality of debug info in general. This is a work in progress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115188 91177308-0d34-0410-b5e6-96231b3b80d8
* Added two new command line arguments:Marcin Swiderski2010-09-301-0/+2
| | | | | | | | -cfg-add-implicit-dtors - sets CFG::BuildOptions::AddImplicitDtors for AnalysisCosumer to true, -cfg-add-initializers - sets CFG::BuildOptions::AddInitializers for AnalysisCosumer to true. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115142 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a -ftrapv-handler= option which allows a handler to invoke instead of ↵David Chisnall2010-09-171-2/+11
| | | | | | simply aborting when a signed operation overflows. This mirrors the (GCC-incompatible) behaviour from clang 1.0 and 1.1 when -ftrapv was specified, but allows the handler to be defined for each compilation unit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114192 91177308-0d34-0410-b5e6-96231b3b80d8
* Added AnalyzerStatsChecker, a path sensitive check that reports visitation ↵Tom Care2010-09-101-0/+3
| | | | | | statistics about analysis. Running clang with the -analyzer-stats flag will emit warnings containing the information. We can then run a postanalysis script to take this data and give useful information about how much the analyzer missed in a project. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113568 91177308-0d34-0410-b5e6-96231b3b80d8
* Frontend: Add -cxx-system-include option which can be used to specify anDaniel Dunbar2010-09-091-0/+6
| | | | | | | explicit list for the C++ system include directories at the -cc1 level, as an alternative to the horrible AddDefaultCPlusPlusIncludePaths(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113505 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for Borland extensions via option -fborland-extensionsDawn Perchik2010-09-021-0/+3
| | | | | | | (original patch r112791 was reverted due to a bug). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112915 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting rev 112791 - apparently -fborland-extensions is on all the time?!Dawn Perchik2010-09-021-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112797 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for Borland extensions via option -fborland-extensionsDawn Perchik2010-09-021-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112791 91177308-0d34-0410-b5e6-96231b3b80d8
* Straighten out target triples provided on the command lineDuncan Sands2010-08-301-1/+2
| | | | | | | before using them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112468 91177308-0d34-0410-b5e6-96231b3b80d8
* Frontend: Add basic -H support.Daniel Dunbar2010-08-241-2/+5
| | | | | | | - I didn't implement the GCC "multiple include guard" detection parts, because it doesn't seem useful or obvious. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111983 91177308-0d34-0410-b5e6-96231b3b80d8
* correct the -isystem option to not add the -isysroot path. Only the weirdChris Lattner2010-08-241-6/+7
| | | | | | | -iwithsysroot flag should do that. This fixes rdar://8345942 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111979 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement -iwithsysroot, an apple extension which is a close cousin of -isystem.Chris Lattner2010-08-241-1/+1
| | | | | | | | Instead of implementing -isystem, I accidentally implemented this cousin. Next up is to implement -isystem right. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111966 91177308-0d34-0410-b5e6-96231b3b80d8
* Abstract out member-pointer creation. I'm really unhappy about the currentJohn McCall2010-08-221-6/+4
| | | | | | | | | | duplication between the constant and non-constant paths in all of this. Implement ARM ABI semantics for member pointer constants and conversion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111772 91177308-0d34-0410-b5e6-96231b3b80d8
* Add machine-parseable Fix-It output as part of diagnostics, under theDouglas Gregor2010-08-191-0/+3
| | | | | | | flag -fdiagnostics-parseable-fixits, from Eelis van der Weegen! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111557 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename the ASTReader header files.Sebastian Redl2010-08-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111474 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename PCHReader to ASTReader.Sebastian Redl2010-08-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111467 91177308-0d34-0410-b5e6-96231b3b80d8
* Reintroduce the serialization library, with fixed dependencies.Sebastian Redl2010-08-171-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111279 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert Sebastian's build-breaking patch.Douglas Gregor2010-08-171-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111265 91177308-0d34-0410-b5e6-96231b3b80d8
* Create a new Serialization module that contains all the PCH code, and will ↵Sebastian Redl2010-08-171-1/+1
| | | | | | contain all the module code in the future. Update the Makefiles, CMake projects and the Xcode project. I hope I did everything right for Xcode. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111258 91177308-0d34-0410-b5e6-96231b3b80d8
* Add two options for playing with modules.Sebastian Redl2010-08-161-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111166 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the code-completion caching infrastructure to include globalDouglas Gregor2010-08-151-0/+4
| | | | | | | | | | | | | | | | | | | | declarations (in addition to macros). Each kind of declaration maps to a certain set of completion contexts, and the ASTUnit completion logic introduces the completion strings for those declarations if the actual code-completion occurs in one of the contexts where it matters. There are a few new code-completion-context kinds. Without these, certain completions (e.g., after "using namespace") would need to suppress all global completions, which would be unfortunate. Note that we don't get the priorities right for global completions, because we don't have enough type information. We'll need a way to compare types in an ASTContext-agnostic way before this can be implemented. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111093 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new cc1 option -fix-what-you-can which when combined with the fix-it modeNick Lewycky2010-08-131-0/+3
| | | | | | | will apply all fixes even when there were other errors in the file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111020 91177308-0d34-0410-b5e6-96231b3b80d8
* Just disable the hidden-visibility optimization for now by hiding it behindJohn McCall2010-08-121-0/+1
| | | | | | | | | | a -cc1 option. The Darwin linker complains about mixed visibility when linking gcc-built objects with clang-built objects, and the optimization isn't really that valuable. Platforms with less ornery linkers can feel free to enable this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110979 91177308-0d34-0410-b5e6-96231b3b80d8
* Frontend: Add -target-linker-version, for specifying the version string of theDaniel Dunbar2010-08-111-1/+6
| | | | | | linker in use. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110871 91177308-0d34-0410-b5e6-96231b3b80d8
* Make -funroll-loops turn on loop unrolling in the optimizer insteadEric Christopher2010-08-071-3/+7
| | | | | | | of just ignoring it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110525 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed IdempotentOperationChecker from default analysis and returned back ↵Tom Care2010-08-061-0/+3
| | | | | | | | | to a flag (-analyzer-check-idempotent-operations) - Added IdempotentOperationChecker to experimental analyses for testing purposes - Updated test cases to explictly call the checker git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110482 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static ↵Ted Kremenek2010-08-031-0/+1
| | | | | | analysis) that doesn't prune CFG edges. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110087 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement -fno-validate-pch at the -cc1 level, which suppresses mostDouglas Gregor2010-07-271-1/+2
| | | | | | | | | | | | | | | | | of the usual consistency checks used to determine when a precompiled header is incompatible with the translation unit it's being loaded into. Enable this option when loading a precompiled preamble, because the preamble loader will be performing all of this checking itself. Enable the preamble-based test now that it's working. This option is also useful for debugging Clang's PCH (<rdar://problem/7532213>). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109475 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce basic support for loading a precompiled preamble whileDouglas Gregor2010-07-261-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | reparsing an ASTUnit. When saving a preamble, create a buffer larger than the actual file we're working with but fill everything from the end of the preamble to the end of the file with spaces (so the lexer will quickly skip them). When we load the file, create a buffer of the same size, filling it with the file and then spaces. Then, instruct the lexer to start lexing after the preamble, therefore continuing the parse from the spot where the preamble left off. It's now possible to perform a simple preamble build + parse (+ reparse) with ASTUnit. However, one has to disable a bunch of checking in the PCH reader to do so. That part isn't committed; it will likely be handled with some other kind of flag (e.g., -fno-validate-pch). As part of this, fix some issues with null termination of the memory buffers created for the preamble; we were trying to explicitly NULL-terminate them, even though they were also getting implicitly NULL terminated, leading to excess warnings about NULL characters in source files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109445 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the "minimal" and printing parser actions, which only everDouglas Gregor2010-07-261-6/+0
| | | | | | | | worked for C anyway. Also kills the -cc1 options -parse-noop and -parse-print-callbacks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109392 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new lexer function to compute the "preamble" of a file,Douglas Gregor2010-07-201-0/+3
| | | | | | | | | | which is the part of the file that contains all of the initial comments, includes, and preprocessor directives that occur before any of the actual code. Added a new -print-preamble cc1 action that is only used for testing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108913 91177308-0d34-0410-b5e6-96231b3b80d8
* Improved false positive rate for the idempotent operations checker and moved ↵Tom Care2010-07-161-4/+0
| | | | | | | | | | it into the default path-sensitive analysis options. - Added checks for static local variables, self assigned parameters, and truncating/extending self assignments - Removed command line option (now default with --analyze) - Updated test cases to pass with idempotent operation warnings git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108550 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce -f{no-}spell-checking options to enable/disableDouglas Gregor2010-07-091-0/+1
| | | | | | | | spell-checking. By default, spell-checking is enabled for Clang (obviously) but disabled in CIndex for performance reasons. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107992 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a frontend option -chained-pch and don't pass an active PCH reader to ↵Sebastian Redl2010-07-091-0/+3
| | | | | | the PCH writer if it is not set, preventing creation of chained PCH files. Since the reader is so far unused, effectively no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107936 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a path-sensitive idempotent operation checker ↵Tom Care2010-07-061-0/+4
| | | | | | | | | | | | | | | | | | | (-analyzer-idempotent-operation). Finds idempotent and/or tautological operations in a path sensitive context, flagging operations that have no effect or a predictable effect. Example: { int a = 1; int b = 5; int c = b / a; // a is 1 on all paths } - New IdempotentOperationChecker class - Moved recursive Stmt functions in r107675 to IdempotentOperationChecker - Minor refactoring of SVal to allow checking for any integer - Added command line option for check - Added basic test cases git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107706 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver/IRgen: Add support for -momit-leaf-frame-pointer.Daniel Dunbar2010-07-011-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107367 91177308-0d34-0410-b5e6-96231b3b80d8