summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Speculative fix to unbreak the buildbots that fail with compiler errors.Argyrios Kyrtzidis2014-05-041-2/+2
| | | | llvm-svn: 207933
* [Modules] Add the resource-dir to the module hash.Argyrios Kyrtzidis2014-05-041-1/+2
| | | | llvm-svn: 207931
* 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). llvm-svn: 207602
* [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 llvm-svn: 207570
* Initial implementation of -modules-earch-all option, for searching for ↵John Thompson2014-04-231-0/+3
| | | | | | symbols in non-imported modules. llvm-svn: 206977
* 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 llvm-svn: 206401
* 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. llvm-svn: 206309
* Add -fmodules-strict-decluse to check that all headers are in modulesDaniel Jasper2014-04-111-1/+3
| | | | | Review: http://reviews.llvm.org/D3335 llvm-svn: 206027
* Support for -Wa,-compress-debug-sections.David Blaikie2014-03-271-0/+1
| | | | | | Also, while I'm here, support -nocompress-debug-sections too. llvm-svn: 204959
* 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 llvm-svn: 204775
* [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. llvm-svn: 204346
* 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 llvm-svn: 204164
* [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 llvm-svn: 203885
* 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. llvm-svn: 203630
* [C++11] Replace OwningPtr include with <memory>.Ahmed Charles2014-03-091-1/+1
| | | | llvm-svn: 203389
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-5/+5
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* [OPENMP] Added option -fopenmp=libiomp5|libgompAlexey Bataev2014-03-061-2/+6
| | | | llvm-svn: 203081
* 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 llvm-svn: 202683
* [C++11] Use std::atomic instead of LLVM's.Benjamin Kramer2014-03-021-3/+3
| | | | | | No intended functionality change. llvm-svn: 202652
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-021-1/+1
| | | | llvm-svn: 202639
* 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. llvm-svn: 202176
* Implement -fno-short-wcharRichard Barton2014-02-241-1/+1
| | | | llvm-svn: 202058
* 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. llvm-svn: 201963
* Accept -no-integrated-as in -cc1 and forward it to llvm.Rafael Espindola2014-02-211-0/+1
| | | | llvm-svn: 201837
* 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 llvm-svn: 201274
* 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. llvm-svn: 201224
* 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 llvm-svn: 201175
* [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 llvm-svn: 201120
* Remove the -fhidden-weak-vtables -cc1 option. It was dead,John McCall2014-02-081-1/+0
| | | | | | gross, and increasingly replaced through other mechanisms. llvm-svn: 201011
* 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 llvm-svn: 200884
* [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. llvm-svn: 199372
* 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 llvm-svn: 199250
* 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. llvm-svn: 199210
* 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. llvm-svn: 199209
* 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 llvm-svn: 199131
* 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. llvm-svn: 198655
* Driver: Accept -fprofile-instr-use and -fprofile-instr-generateJustin Bogner2014-01-061-0/+2
| | | | | | These flags will be used for instrumentation based PGO. llvm-svn: 198639
* Silence a dubious GCC warning about a set but unused global. Indeed, theChandler Carruth2013-12-281-1/+1
| | | | | | purpose of this global is to be set and not used. =] llvm-svn: 198094
* Bury leaked pointers in a global array to silence a leak detector in ↵Kostya Serebryany2013-12-271-0/+16
| | | | | | | | | | | | | | | | --disable-free mode Summary: This is an alternative to http://llvm-reviews.chandlerc.com/D2475 suggested by Chandler. Reviewers: chandlerc, rnk, dblaikie CC: cfe-commits, earthdok Differential Revision: http://llvm-reviews.chandlerc.com/D2478 llvm-svn: 198073
* [Driver] Rename '-objcmt-white-list-dir-path' option to ↵Argyrios Kyrtzidis2013-12-101-1/+1
| | | | | | '-objcmt-whitelist-dir-path' and add an alias for now. llvm-svn: 196944
* [objcmt] Add a modernization option to infer and suggest designated ↵Argyrios Kyrtzidis2013-12-101-0/+2
| | | | | | | | initializers. rdar://15509284 llvm-svn: 196943
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-051-1/+2
| | | | llvm-svn: 196510
* Remove a whole lot of unused variablesAlp Toker2013-11-271-1/+0
| | | | | | | There are about 30 removed in this patch, generated by a new FixIt I haven't got round to submitting yet. llvm-svn: 195814
* Using an invalid -O falls back on -O3 instead of an errorSylvestre Ledru2013-11-181-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently with clang: $ clang -O20 foo.c error: invalid value '20' in '-O20' With the patch: $ clang -O20 foo.c warning: optimization level '-O20' is unsupported; using '-O3' instead. 1 warning generated. This matches the gcc behavior (with a warning added) Pass all tests: Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. Testing Time: 94.14s Expected Passes : 6721 Expected Failures : 20 Unsupported Tests : 17 (which was not the case of http://llvm-reviews.chandlerc.com/D2125) Differential Revision: http://llvm-reviews.chandlerc.com/D2212 llvm-svn: 195009
* Add -freroll-loops to enable loop rerollingHal Finkel2013-11-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds -freroll-loops (and -fno-reroll-loops in the usual way) to enable loop rerolling as part of the optimization pass manager. This transformation can enable vectorization, reduce code size (or both). Briefly, loop rerolling can transform a loop like this: for (int i = 0; i < 3200; i += 5) { a[i] += alpha * b[i]; a[i + 1] += alpha * b[i + 1]; a[i + 2] += alpha * b[i + 2]; a[i + 3] += alpha * b[i + 3]; a[i + 4] += alpha * b[i + 4]; } into this: for (int i = 0; i < 3200; ++i) { a[i] += alpha * b[i]; } Loop rerolling is currently disabled by default at all optimization levels. llvm-svn: 194967
* Revert "Using an invalid -O falls back on -O3 instead of an error"Alp Toker2013-11-151-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Trying to fix test failures since earlier today. One of the tests added in this commit is outputting test/Driver/clang_f_opts.s which the builders that build in-tree (eg. clang-native-arm-cortex-a9) are trying to run as a test case, causing failures. clang_f_opts.c: If -### doesn't emit the warning then this test probably shouldn't be in here in the first place. Frontend maybe? invalid-o-level.c: Running %clang_cc1 in the Driver tests doesn't make sense because -cc1 bypasses the driver. (I'm not reverting the commit that introduced this but please fix instead of keeping it this way.) Reverting to fix the build failures and also so that the tests can be thought out more thoroughly. This reverts commit r194817. llvm-svn: 194845
* Using an invalid -O falls back on -O3 instead of an errorSylvestre Ledru2013-11-151-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently with clang: $ clang -O20 foo.c error: invalid value '20' in '-O20' With the patch: $ clang -O20 foo.c warning: optimization level '-O20' is unsupported; using '-O3' instead. 1 warning generated. This matches the gcc behavior (with a warning added) Pass all tests: Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. Testing Time: 94.14s Expected Passes : 6721 Expected Failures : 20 Unsupported Tests : 17 (which was not the case of http://llvm-reviews.chandlerc.com/D2125) Reviewers: chandlerc, rafael, rengolin, hfinkel Reviewed By: rengolin CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2152 llvm-svn: 194817
* [objcmt] Introduce "objcmt-white-list-dir-path=" option.Argyrios Kyrtzidis2013-11-141-0/+2
| | | | | | | This options accepts a path to a directory, collects the filenames of the files it contains, and the migrator will only modify files with the same filename. llvm-svn: 194710
* Add -fprofile-sample-use to Clang's driver.Diego Novillo2013-11-131-0/+1
| | | | | | | | This adds a new option -fprofile-sample-use=filename to Clang. It tells the driver to schedule the SampleProfileLoader pass and passes on the name of the profile file to use. llvm-svn: 194567
* ObjectiveC migrator. Place use of NS_NONATOMIC_IOSONLYFariborz Jahanian2013-11-131-0/+2
| | | | | | | | on inferred property attribute under -objcmt-ns-nonatomic-iosonly option. // rdar://15442742 llvm-svn: 194532
OpenPOWER on IntegriCloud