summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] Rework inlining related command line options.Anna Zaks2012-03-081-3/+63
| | | | | | | | | - Remove -analyzer-inline-call. - Add -analyzer-ipa=[none|inlining] - Add -analyzer-inlining-mode to allow experimentation for different performance tuning methods. llvm-svn: 152351
* Workaround module test failures by removing the version info from module hashes.Bob Wilson2012-03-071-1/+4
| | | | | | | | | | PR12196: The module hash strings are not actually hashing the compiler version string; the entire version string is being included in the hash. Depending on the module cache directory name, that can lead to failures where the path names become too long. As a temporary workaround, just remove the version string from the hash. llvm-svn: 152266
* [driver] What was implemented in r152130 was actually -fno-inline-functions, notChad Rosier2012-03-061-3/+4
| | | | | | | -fno-inline. Part of rdar://10972766 llvm-svn: 152145
* Add new code migrator support for migrating existing Objective-C code to useTed Kremenek2012-03-061-5/+26
| | | | | | | | | | | the new Objective-C NSArray/NSDictionary/NSNumber literal syntax. This introduces a new library, libEdit, which provides a new way to support migration of code that improves on the original ARC migrator. We now believe that most of its functionality can be refactored into the existing libraries, and thus this new library may shortly disappear. llvm-svn: 152141
* [driver] Add support for -fno-inline.Chad Rosier2012-03-061-2/+4
| | | | | | rdar://10972766 llvm-svn: 152130
* [analyzer] Bound the size of the functions being inlined + provideAnna Zaks2012-03-021-0/+6
| | | | | | | | | | | command line options for inlining tuning. This adds the option for stack depth bound as well as function size bound. + minor doxygenification llvm-svn: 151930
* [analyzer] Turn inlining on by default for better testing exposure.Anna Zaks2012-03-011-1/+2
| | | | | | Fix a test, which was most likely an unintended recursive call. llvm-svn: 151848
* Add a flag -fthread-sanitizer.Kostya Serebryany2012-03-011-0/+3
| | | | | | | | | | This flag enables ThreadSanitizer instrumentation committed to llvm as r150423. The patch includes one test for -fthread-sanitizer and one similar test for -faddress-sanitizer. This patch does not modify the linker flags (as we do it for -faddress-sanitizer) because the run-time library is not yet committed and it's structure in compiler-rt is not 100% clear. The users manual wil be changed in a separate commit. llvm-svn: 151846
* [analyzer] Add -analyzer-stats, which hooks up LLVM stats tracking.Anna Zaks2012-02-271-0/+1
| | | | | | As in http://llvm.org/docs/ProgrammersManual.html#Statistic llvm-svn: 151570
* Basic: import IntrusiveRefCntPtr<> into clang namespaceDylan Noblesmith2012-02-201-1/+1
| | | | | | | The class name is long enough without the llvm:: added. Also bring in RefCountedBase and RefCountedBaseVPTR. llvm-svn: 150958
* Remove the unuseful -fdiagnostics-show-nameDavid Blaikie2012-02-151-3/+0
| | | | | | | | | | | | | | This option was added in r129614 and doesn't have any use case that I'm aware of. It's possible that external tools are using these names - and if that's the case we can certainly reassess the functionality, but for now it lets us shave out a few unneeded bits from clang. Move the "StaticDiagNameIndex" table into the only remaining consumer, diagtool. This removes the actual diagnostic name strings from clang entirely. Reviewed by Chris Lattner & Ted Kremenek. llvm-svn: 150612
* Invalid O levels on the command line no longer have a confusing error.Aaron Ballman2012-02-061-4/+5
| | | | llvm-svn: 149852
* Basic: import OwningPtr<> into clang namespaceDylan Noblesmith2012-02-051-2/+2
| | | | llvm-svn: 149798
* Clang has existing support for debuggers thatSean Callanan2012-02-041-0/+3
| | | | | | | | | | | | | | | | | | | | want to provide "po"-like functionality which treats the result of an expression implicitly as "id" (if it is not otherwise known) and prints it as an Objective-C object. This has in the past been gated by the "DebuggerSupport" language option, but that is too general. Debuggers also provide other commands like "print" that do not make any assumptions about whether the object is an Objective-C object. This patch makes the assumption conditional on a new language option: DebuggerCastResultToId. I have also made corresponding modifications to the testsuite. llvm-svn: 149735
* Fix -ftrap-function fallout from llvm r145714. <rdar://problem/10799325>Bob Wilson2012-02-031-0/+1
| | | | | | | | | That llvm change removed the -trap-func backend option, so that using -ftrap-function with clang would cause the backend to complain. Fix it by adding the trap function name to the CodeGenOptions and passing it through to the TargetOptions. llvm-svn: 149679
* Rename -dependency-graphviz to -dependencncy-dotDouglas Gregor2012-02-021-1/+1
| | | | llvm-svn: 149645
* Introduce a -cc1 option "-dependency-graphviz" that determines headerDouglas Gregor2012-02-021-0/+1
| | | | | | dependencies and outputs them in GraphViz format. llvm-svn: 149575
* Complain about attempts to use 'protected' visibility on targetsJohn McCall2012-01-291-0/+1
| | | | | | | | like Darwin that don't support it. We should also complain about invalid -fvisibility=protected, but that information doesn't seem to exist at the most appropriate time, so I've left a FIXME behind. llvm-svn: 149186
* objc-arc: introduce -no-finalize-removal which in gc mode,Fariborz Jahanian2012-01-261-0/+1
| | | | | | | | leaves "finalize' behind and in arc mode, does not include it. This allows the migrated source to be compiled in both gc and arc mode. // rdar://10532441 llvm-svn: 149079
* Extend the ExternalASTSource interface to allow the AST source toDouglas Gregor2012-01-261-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | provide the layout of records, rather than letting Clang compute the layout itself. LLDB provides the motivation for this feature: because various layout-altering attributes (packed, aligned, etc.) don't get reliably get placed into DWARF, the record layouts computed by LLDB from the reconstructed records differ from the actual layouts, and badness occurs. This interface lets the DWARF data drive layout, so we don't need the attributes preserved to get the answer write. The testing methodology for this change is fun. I've introduced a variant of -fdump-record-layouts called -fdump-record-layouts-simple that always has the simple C format and provides size/alignment/field offsets. There is also a -cc1 option -foverride-record-layout=<file> to take the output of -fdump-record-layouts-simple and parse it to produce a set of overridden layouts, which is introduced into the AST via a testing-only ExternalASTSource (called LayoutOverrideSource). Each test contains a number of records to lay out, which use various layout-changing attributes, and then dumps the layouts. We then run the test again, using the preprocessor to eliminate the layout-changing attributes entirely (which would give us different layouts for the records), but supplying the previously-computed record layouts. Finally, we diff the layouts produced from the two runs to be sure that they are identical. Note that this code makes the assumption that we don't *have* to provide the offsets of bases or virtual bases to get the layout right, because the alignment attributes don't affect it. I believe this assumption holds, but if it does not, we can extend LayoutOverrideSource to also provide base offset information. Fixes the Clang side of <rdar://problem/10169539>. llvm-svn: 149055
* Introduce 3 new fixit options:Argyrios Kyrtzidis2012-01-261-0/+9
| | | | | | | | | | | | | | -fixit-recompile applies fixits and recompiles the result -fixit-to-temporary applies fixits to temporary files -fix-only-warnings">, applies fixits for warnings only, not errors Combining "-fixit-recompile -fixit-to-temporary" allows testing the result of fixits without touching the original sources. llvm-svn: 149027
* arc migrator: Provide infrastructure to add optionsFariborz Jahanian2012-01-251-0/+6
| | | | | | | | | specific to migrator. Use its first option to warn migrating from GC to arc when NSAllocateCollectable/NSReallocateCollectable is used. // rdar://10532541 llvm-svn: 148887
* Add support for -fno-optimize-sibling-calls. Currently only implemented in theNick Lewycky2012-01-231-0/+3
| | | | | | X86 backend in LLVM. llvm-svn: 148689
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-2/+0
| | | | llvm-svn: 148577
* Extract the (InputKind, std::string) pair used to describe inputs toDouglas Gregor2012-01-201-6/+6
| | | | | | | the front end into its own class, FrontendInputFile, to make it easier to introduce new per-input data. No functionality change. llvm-svn: 148546
* Add a "Modules" language option, which subsumes the previousDouglas Gregor2012-01-031-1/+3
| | | | | | "AutoModuleImport" preprocessor option and is tied to -fmodules. llvm-svn: 147448
* Rename the command-line option for mapping #include/#import over toDouglas Gregor2012-01-031-1/+1
| | | | | | | | module imports from -fauto-module-import to -fmodules. The new name will eventually be used to enable modules, and the #include/#import mapping is a crucial part of the feature. llvm-svn: 147447
* Fix PR11685 by implementing -ffast-math and its various friends in theChandler Carruth2012-01-021-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Clang driver. This involves a bunch of silly option parsing code to try to carefully emulate GCC's options. Currently, this takes a conservative approach, and unless all of the unsafe optimizations are enabled, none of them are. The fine grained control doesn't seem particularly useful. If it ever becomes useful, we can add that to LLVM first, and then expose it here. This also fixes a few tiny bugs in the flag management around -fhonor-infinities and -fhonor-nans; the flags now form proper sets both for enabling and disabling, with the last flag winning. I've also implemented a moderately terrifying GCC feature where a language change is also provided by the '-ffast-math' flag by defining the __FAST_MATH__ preprocessor macro. This feature is tracked and serialized in the frontend but it isn't used yet. A subsequent patch will add the preprocessor macro and tests for it. I've manually tested that codegen appears to respect this, but I've not dug in enough to see if there is an easy way to test codegen options w/o relying on the particulars of LLVM's optimizations. llvm-svn: 147434
* Mass rename C1x references to C11. The name hasn't proliferated like "C++0x" ↵Benjamin Kramer2011-12-231-1/+1
| | | | | | | | so this patch is surprisingly small. Also drop -Wc1x-extensions in favor of -Wc11-extensions. I don't think we need to keep this around for compatibility. llvm-svn: 147221
* Let CompilerInvocation initialization indicate failureDylan Noblesmith2011-12-231-29/+61
| | | | | | | | | This fixes the FIXMEs in ParseAnalyzeArgs. (Also a precursor to moving the analyzer into an AST plugin.) For consistency, do the same with AssemblerInvocation. llvm-svn: 147218
* C++11 constexpr: Add note stacks containing backtraces if constant evaluationRichard Smith2011-12-161-0/+9
| | | | | | | | | | fails within a call to a constexpr function. Add -fconstexpr-backtrace-limit argument to driver and frontend, to control the maximum number of notes so produced (default 10). Fix APValue printing to be able to pretty-print all APValue types, and move the testing for this functionality from a unittest to a -verify test now that it's visible in clang's output. llvm-svn: 146749
* Per discussion on the list, remove BitcodeVerify pass to reimplement as a ↵Chad Rosier2011-12-141-3/+0
| | | | | | free function. llvm-svn: 146530
* Add frontend flags to enable bitcode verifier pass.Chad Rosier2011-12-121-0/+3
| | | | llvm-svn: 146441
* Hexagon backend supportTony Linthicum2011-12-121-0/+1
| | | | llvm-svn: 146413
* Driver: Handle -f{no-}honor-infinities, -f{no-}honor-nans, andDaniel Dunbar2011-12-091-2/+10
| | | | | | | | -ffinite-math-only. - No test case yet, I don't know how to construct a situation where this matters. llvm-svn: 146297
* Stack realignment is a tristate. Add -mno-stackrealign to turn off all stackNick Lewycky2011-12-061-1/+1
| | | | | | realignment, even with locals with alignment exceeding the ABI guarantee. llvm-svn: 145909
* Add -mstack-alignment=X and fix -mstackrealign handling now that theJoerg Sonnenberger2011-12-051-0/+5
| | | | | | backend options are gone. llvm-svn: 145868
* Eliminate the -emit-module option, which emitted a module by parsing aDouglas Gregor2011-11-291-3/+0
| | | | | | | source file (e.g., a header). Immediately steal this useful option name for building modules from a module map file. llvm-svn: 145444
* Silence GCC warnings, RefCountedBase is meant to be default-initialized here.Benjamin Kramer2011-11-291-1/+2
| | | | llvm-svn: 145396
* Set __OPTIMIZE_SIZE__ on -Os and -Oz. This matches gcc's behaviour on both OS XRafael Espindola2011-11-261-1/+1
| | | | | | and linux. llvm-svn: 145142
* implement __has_feature(address_sanitizer); also use ↵Kostya Serebryany2011-11-221-3/+3
| | | | | | LangOpts.AddressSanitizer instead of CodeGenOpts.AddressSanitizer llvm-svn: 145054
* Add driver arguments -ftemplate-depth=N and -fconstexpr-depth=N, with the sameRichard Smith2011-11-211-1/+7
| | | | | | | | | | | | | semantics and defaults as the corresponding g++ arguments. The historical g++ argument -ftemplate-depth-N is kept for compatibility, but modern g++ versions no longer document that option. Add -cc1 argument -fconstexpr-depth N to implement the corresponding functionality. The -ftemplate-depth=N part of this fixes PR9890. llvm-svn: 145045
* Refine placement of LangOptions object in CompilerInvocation by adding a new ↵Ted Kremenek2011-11-181-4/+3
| | | | | | baseclass CompilerInvocationBase with a custom copy constructor. This ensures that whenever the CompilerInvocation object's copy constructor is used we always clone the LangOptions object. llvm-svn: 144973
* Make 'LangOptions' in CompilerInvocation a heap-allocated, reference counted ↵Ted Kremenek2011-11-171-5/+20
| | | | | | | | | | | | | | | | | object. I discovered that llvm::RefCountedBase<T> has a bug where the reference count is copied in the copy constructor, which means that there were cases when the CompilerInvocation objects created by ASTUnit were actually leaked. When I fixed that bug locally, it showed that a whole bunch of code assumed that the LangOptions object that was part of CompilerInvocation was still alive. By making it heap-allocated and reference counted, we can keep it around after the CompilerInvocation object goes away. As part of this change, change CompilerInvocation:getLangOptions() to return a pointer, acting as another clue that this object may outlive the CompilerInvocation object. This commit doesn't fix the CompilerInvocation leak itself. That will come when I commit the fix to llvm::RefCountedBase<T> to mainline LLVM. llvm-svn: 144930
* Add -f[no-]address-sanitizer flagKostya Serebryany2011-11-161-0/+3
| | | | llvm-svn: 144800
* Add support for building a module from a module map to the -cc1Douglas Gregor2011-11-161-0/+3
| | | | | | | interface. This is currently limited to modules with umbrella headers. llvm-svn: 144736
* Add a -cc1-level option -fmodule-name=<name>, which will be used whenDouglas Gregor2011-11-151-0/+3
| | | | | | building modules. llvm-svn: 144680
* Rip out one of the features I added for the driver-include-management.Chandler Carruth2011-11-071-8/+3
| | | | | | | | | | | | | | | | We don't actually need a separate flag for non-sysrooted paths as the driver has to manage the sysroot anyways. The driver is not infrequently adding paths to the header search based on their existence on the filesystem. For that, it has to add the sysroot anyways, we should pass it on down to CC1 already joined. More importantly, the driver cannot in all cases distinguish between sysrooted paths and paths that are relative to the Clang binary's installation directory. Essentially, we always need to ignore the system root for these internal header search options. It turns out in most of the places we were already providing the system root in the driver, and then another one in CC1 so this fixes several bugs. llvm-svn: 143917
* Fix a significant oversight in my move of MSVC includes to the driver:Chandler Carruth2011-11-051-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | actually manage the builtin header file includes as well as the system ones. This one is actually debatable whether it belongs in the driver or not, as the builtin includes are really an internal bit of implementation goop for Clang. However, they must be included at *exactly* the right point in the sequence of header files, which makes it essentially impossible to have this be managed by the Frontend and the rest by the Driver. I have terrible ideas that would "work", but I think they're worse than putting this in the driver and making the Frontend library even more ignorant of the environment and system on which it is being run. Also fix the fact that we weren't properly respecting the flags which suppress standard system include directories. Note that this still leaves all of the Clang tests which run CC1 directly and include builtin header files broken on Windows. I'm working on a followup patch to address that. llvm-svn: 143801
* Add two flags to the CC1 layer that I was hoping to avoid. We need toChandler Carruth2011-11-051-4/+19
| | | | | | | | | | | | | | | | | | | | encode the *exact* semantics which the header search paths internally built by the Frontend layer have had, which is both non-user-provided, and at times adding the implicit extern "C" bit to the directory entry. There are lots of CC1 options that are very close, but none do quite this, and they are all already overloaded for other purposes. In some senses this makes the command lines more clean as it clearly indicates which flags are exclusively used to implement internal detection of "standard" header search paths. Lots of the implementation of this is really crufty, due to the surrounding cruft. It doesn't seem worth investing lots of time cleaning this up as it isn't new, and hopefully *lots* of this code will melt away as header search inside of the frontend becomes increasingly trivial. llvm-svn: 143798
OpenPOWER on IntegriCloud