summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [C++1z] Implement N3981: Disable trigraphs by default in C++1z mode.Richard Smith2014-06-201-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211392 91177308-0d34-0410-b5e6-96231b3b80d8
* Frontend: Add a CC1 flag to dump module dependencies to a directoryJustin Bogner2014-06-191-0/+2
| | | | | | | | | | | | | | | | | | This adds the -module-dependency-dir to clang -cc1, which specifies a directory to copy all of a module's dependencies into in a form suitable to be used as a VFS using -ivfsoverlay with the generated vfs.yaml. This is useful for crashdumps that involve modules, so that the module dependencies will be intact when a crash report script is used to reproduce a problem on another machine. We currently encode the absolute path to the dump directory, due to limitations in the VFS system. Until we can handle relative paths in the VFS, users of the VFS map may need to run a simple search and replace in the file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211303 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead code.Diego Novillo2014-06-171-11/+0
| | | | | | | | The parsing for -Rpass= had been factored into the function GenerateOptimizationRemarkRegex, but at the time I forgot to remove the original code that just handled OPT_Rpass_EQ. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211122 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -std=c++1z flag for C++17 features.Richard Smith2014-06-161-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211030 91177308-0d34-0410-b5e6-96231b3b80d8
* Include system_error directly.Rafael Espindola2014-06-121-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210802 91177308-0d34-0410-b5e6-96231b3b80d8
* There is no std::errc:success, remove the llvm one.Rafael Espindola2014-05-311-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209959 91177308-0d34-0410-b5e6-96231b3b80d8
* Add flags -Rpass-missed and -Rpass-analysis.Diego Novillo2014-05-291-0/+28
| | | | | | | | | | | | | | | | | | | | | | Summary: These two flags are in the same family as -Rpass, but are used in different situations. -Rpass-missed is used by optimizers to inform the user when they tried to apply an optimization but couldn't (or wouldn't). -Rpass-analysis is used by optimizers to report analysis results back to the user (e.g., why the transformation could not be applied). Depends on D3682. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3683 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209839 91177308-0d34-0410-b5e6-96231b3b80d8
* No longer allow the -std options to entirely override the -x language ↵Aaron Ballman2014-05-291-11/+5
| | | | | | option. This allows -x cuda -std=c++11, for instance. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209824 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'. Frontend edition.Craig Topper2014-05-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209389 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DiagnosticsEngine non-copyableAlp Toker2014-05-111-0/+2
| | | | | | | | Also provide an out-of-line dtor for CompilerInvocation. Cleanup work that may help reduce header inclusion for IntrusiveRefCntPtr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208512 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable standalone-debug by default on FreeBSDEd Maste2014-05-081-3/+4
| | | | | | | | | | | | | It was set by default on Darwin in r198655. The same usability issues with DTrace and LLDB apply to FreeBSD, so set it by default there too. rdar://problem/15758808 http://llvm.org/pr19676 Differential Revision: http://reviews.llvm.org/D3448 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208310 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: parse -mcmodel earlierSaleem Abdulrasool2014-05-081-1/+13
| | | | | | | | | | | This addresses an existing FIXME item in the driver. The code model flag was parsed in the actual tool rather than in the driver. This was problematic since the value may be invalid. In that case, we would silently treat it as a default value in non-assert builds, and abort in assert builds. Add a check in the driver to validate that the value being passed is valid, and if not provide a proper error message. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208275 91177308-0d34-0410-b5e6-96231b3b80d8
* If an instantiation of a template is required to be a complete type, checkRichard Smith2014-05-071-0/+1
| | | | | | | | whether the definition of the template is visible rather than checking whether the instantiated definition happens to be in an imported module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208150 91177308-0d34-0410-b5e6-96231b3b80d8
* Speculative fix to unbreak the buildbots that fail with compiler errors.Argyrios Kyrtzidis2014-05-041-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207933 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Add the resource-dir to the module hash.Argyrios Kyrtzidis2014-05-041-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207931 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop non-cfi assembly support from clang.Rafael Espindola2014-04-301-1/+0
| | | | | | | | | | | | | | After this patch clang will ignore -fdwarf2-cfi-asm and -ffno-dwarf2-cfi-asm and always print assembly that uses cfi directives. In llvm, MC itself supports cfi since the end of 2010 (support started in r119972, is reported in the 2.9 release notes). In binutils the support has been around for much longer. It looks like support started to be added in May 2003. It is available in 2.15 (31-Aug-2011, 2.14 is from 12-Jun-2003). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207602 91177308-0d34-0410-b5e6-96231b3b80d8
* [PCH/Modules] Don't tie TargetOptions::LinkerVersion to a module/PCH, it's a ↵Argyrios Kyrtzidis2014-04-291-1/+1
| | | | | | | | driver only thing and doesn't affect any language/preprocessor/etc. semantics. rdar://16714526 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207570 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial implementation of -modules-earch-all option, for searching for ↵John Thompson2014-04-231-0/+3
| | | | | | symbols in non-imported modules. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206977 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for optimization reports.Diego Novillo2014-04-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds a new flag -Rpass=. The flag indicates the name of the optimization pass that should emit remarks stating when it made a transformation to the code. This implements the design I proposed in: https://docs.google.com/document/d/1FYUatSjZZO-zmFBxjOiuOzAy9mhHA8hqdvklZv68WuQ/edit?usp=sharing Other changes: - Add DiagnosticIDs::isRemark(). Use it in printDiagnosticOptions to print "-R" instead of "-W" in the diagnostic message. - In BackendConsumer::OptimizationRemarkHandler, get a SourceLocation object out of the file name, line and column number. Use that location in the call to Diags.Report(). - When -Rpass is used without debug info a note is emitted alerting the user that they need to use -gline-tables-only -gcolumn-info to get this information. CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3226 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206401 91177308-0d34-0410-b5e6-96231b3b80d8
* Honour -ivfsoverlay in ASTUnit to match clangBen Langmuir2014-04-151-1/+28
| | | | | | | This allows code indexing, etc. to use the VFS in the same way as the compiler. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206309 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -fmodules-strict-decluse to check that all headers are in modulesDaniel Jasper2014-04-111-1/+3
| | | | | | Review: http://reviews.llvm.org/D3335 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206027 91177308-0d34-0410-b5e6-96231b3b80d8
* Support for -Wa,-compress-debug-sections.David Blaikie2014-03-271-0/+1
| | | | | | Also, while I'm here, support -nocompress-debug-sections too. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204959 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the -i[no-]system-prefix options from CC1Options.td to Options.td.Alexander Kornienko2014-03-261-4/+4
| | | | | | | | | | | | | | | | Summary: This allows them to be used without -cc1 the same way as -I and -isystem. Renamed the options to --system-header-prefix=/--no-system-header-prefix to avoid interference with -isystem and make the intent of the option cleaner. Reviewers: rsmith Reviewed By: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3185 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204775 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] -fsanitize-memory-track-origins=[level] flag and docs.Evgeniy Stepanov2014-03-201-2/+2
| | | | | | | | | | This change turns -fsanitize-memory-track-origins into -fsanitize-memory-track-origins=[level] flag (keeping the old one for compatibility). Possible levels are 0 (off), 1 (default) and 2 (incredibly detailed). See docs (part of this patch) for more info. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204346 91177308-0d34-0410-b5e6-96231b3b80d8
* Creating a printing policy for "half":Yunzhong Gao2014-03-181-0/+3
| | | | | | | | | | | | | | Since "half" is an OpenCL keyword and clang accepts __fp16 as an extension for other languages, error messages and metadata (and hence debug info) should refer to the half-precision floating point as "__fp16" instead of "half" when compiling for non-OpenCL languages. This patch creates a new printing policy for half in a similar manner to what is done for bool and wchar_t. Differential Revision: http://llvm-reviews.chandlerc.com/D2952 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204164 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Emit the module file paths as dependencies of the PCH when we are ↵Argyrios Kyrtzidis2014-03-141-0/+1
| | | | | | | | | | | building one. This is because the PCH is tied to the module files, if one of the module files changes or gets removed the build system should re-build the PCH file. rdar://16321245 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203885 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an option -fmodules-validate-system-headersBen Langmuir2014-03-121-0/+3
| | | | | | | | When enabled, always validate the system headers when loading a module. The end result of this is that when these headers change, we will notice and rebuild the module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203630 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-5/+5
| | | | | | 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
* [OPENMP] Added option -fopenmp=libiomp5|libgompAlexey Bataev2014-03-061-2/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203081 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce '-fmodules-user-build-path' which accepts the "canonical" path to ↵Argyrios Kyrtzidis2014-03-031-0/+4
| | | | | | | | | | a user workspace build. This is used to avoid conflicts with user modules with the same name from different workspaces. rdar://16042513 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202683 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use std::atomic instead of LLVM's.Benjamin Kramer2014-03-021-3/+3
| | | | | | No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202652 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202639 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a driver option -ivfsoverlayBen Langmuir2014-02-251-0/+4
| | | | | | | Reads the description of a virtual filesystem from a file and overlays it over the real file system. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202176 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement -fno-short-wcharRichard Barton2014-02-241-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202058 91177308-0d34-0410-b5e6-96231b3b80d8
* clang: add -f{no-,}integrate-as as consistent parametersSaleem Abdulrasool2014-02-231-1/+1
| | | | | | | | The integrated assembler is a feature. This makes the new flags the default option, and the previous versions aliases. Ideally, at some point the aliases would be entirely removed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201963 91177308-0d34-0410-b5e6-96231b3b80d8
* Accept -no-integrated-as in -cc1 and forward it to llvm.Rafael Espindola2014-02-211-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201837 91177308-0d34-0410-b5e6-96231b3b80d8
* MS ABI: Implement #pragma vtordisp() and clang-cl /vdNReid Kleckner2014-02-121-0/+1
| | | | | | | | | | | | | | | | | These features are new in VS 2013 and are necessary in order to layout std::ostream correctly. Currently we have an ABI incompatibility when self-hosting with the 2013 stdlib in our convertible_fwd_ostream wrapper in gtest. This change adds another implicit attribute, MSVtorDispAttr, because implicit attributes are currently the best way to make sure the information stays on class templates through instantiation. Reviewers: majnemer Differential Revision: http://llvm-reviews.chandlerc.com/D2746 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201274 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an option to allow Clang verify source files for a module only once duringDmitri Gribenko2014-02-121-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | the build When Clang loads the module, it verifies the user source files that the module was built from. If any file was changed, the module is rebuilt. There are two problems with this: 1. correctness: we don't verify system files (there are too many of them, and stat'ing all of them would take a lot of time); 2. performance: the same module file is verified again and again during a single build. This change allows the build system to optimize source file verification. The idea is based on the fact that while the project is being built, the source files don't change. This allows us to verify the module only once during a single build session. The build system passes a flag, -fbuild-session-timestamp=, to inform Clang of the time when the build started. The build system also requests to enable this feature by passing -fmodules-validate-once-per-build-session. If these flags are not passed, the behavior is not changed. When Clang verifies the module the first time, it writes out a timestamp file. Then, when Clang loads the module the second time, it finds a timestamp file, so it can compare the verification timestamp of the module with the time when the build started. If the verification timestamp is too old, the module is verified again, and the timestamp file is updated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201224 91177308-0d34-0410-b5e6-96231b3b80d8
* MS ABI: Add support for the -vm{b,g,s,m,v} flagsDavid Majnemer2014-02-111-0/+18
| | | | | | | | | | These flags control the inheritance model initially used by the translation unit. Differential Revision: http://llvm-reviews.chandlerc.com/D2741 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201175 91177308-0d34-0410-b5e6-96231b3b80d8
* [stackprotector] Add command line option -fstack-protector-strongJosh Magee2014-02-111-1/+2
| | | | | | | | | | | This option has the following effects: * It adds the sspstrong IR attribute to each function within the CU. * It defines the macro __SSP_STRONG__ with the value of 2. Differential Revision: http://llvm-reviews.chandlerc.com/D2717 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201120 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the -fhidden-weak-vtables -cc1 option. It was dead,John McCall2014-02-081-1/+0
| | | | | | gross, and increasingly replaced through other mechanisms. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201011 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a CC1 option -verify-pchBen Langmuir2014-02-051-0/+3
| | | | | | | | | This option will: - load the given pch file - verify it is not out of date by stat'ing dependencies, and - return 0 on success and non-zero on error git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200884 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Remove -fsanitize-address-zero-base-shadow command lineEvgeniy Stepanov2014-01-161-2/+0
| | | | | | | | | | | | | | | | | | flag from clang, and disable zero-base shadow support on all platforms where it is not the default behavior. - It is completely unused, as far as we know. - It is ABI-incompatible with non-zero-base shadow, which means all objects in a process must be built with the same setting. Failing to do so results in a segmentation fault at runtime. - It introduces a backward dependency of compiler-rt on user code, which is uncommon and complicates testing. This is the Clang part of a larger change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199372 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-141-8/+1
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199250 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch around the order of MSVCCompat and MicrosoftExtAlp Toker2014-01-141-2/+1
| | | | | | | | | | | | Full language modes usually get listed before minor language extensions in LangOpts, so that subsequent sub-modes can predicate on the major modes. This also lends to a cleanup in CompilerInvocation to better indicate to the reader that MSVCCompat is a superset of MicrosoftExt. Cleanup only. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199210 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename language option MicrosoftMode to MSVCCompatAlp Toker2014-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | There's been long-standing confusion over the role of these two options. This commit makes the necessary changes to differentiate them clearly, following up from r198936. MicrosoftExt (aka. fms-extensions): Enable largely unobjectionable Microsoft language extensions to ease portability. This mode, also supported by gcc, is used for building software like FreeBSD and Linux kernel extensions that share code with Windows drivers. MSVCCompat (aka. -fms-compatibility, formerly MicrosoftMode): Turn on a special mode supporting 'heinous' extensions for drop-in compatibility with the Microsoft Visual C++ product. Standards-compilant C and C++ code isn't guaranteed to work in this mode. Implies MicrosoftExt. Note that full -fms-compatibility mode is currently enabled by default on the Windows target, which may need tuning to serve as a reasonable default. See cfe-commits for the full discourse, thread 'r198497 - Move MS predefined type_info out of InitializePredefinedMacros' No change in behaviour. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199209 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the MS ABI for Win32 targets by defaultHans Wennborg2014-01-131-2/+5
| | | | | | | | | | In addition to being a sensible default, this is a huge improvement in test coverage for the MS ABI: any bot that targets Win32 will now run the test suite using the MS ABI by default. Differential Revision: http://llvm-reviews.chandlerc.com/D2401 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199131 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a new -fstandalone-debug option. rdar://problem/15685848Adrian Prantl2014-01-071-8/+14
| | | | | | | | | | | | | | It controls everything that -flimit-debug-info used to, plus the vtable type optimization. The old -fno-limit-debug-info option is now an alias to -fstandalone-debug and vice versa. Standalone is the default on Darwin until dtrace is updated to work with non-standalone debug info (rdar://problem/15758808). Note: I kept the LimitedDebugInfo name in CodeGenOptions::DebugInfoKind because NoStandaloneDebugInfo sounded even more confusing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198655 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: Accept -fprofile-instr-use and -fprofile-instr-generateJustin Bogner2014-01-061-0/+2
| | | | | | These flags will be used for instrumentation based PGO. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198639 91177308-0d34-0410-b5e6-96231b3b80d8