summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/LangOptions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [OpenCL] Factor out language version printingSven van Haastregt2018-05-081-0/+5
| | | | | | | | | Generate a printable OpenCL language version number in a single place and select between the OpenCL C or OpenCL C++ version accordingly. Differential Revision: https://reviews.llvm.org/D46382 llvm-svn: 331766
* [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-02-161-4/+3
| | | | | | other minor fixes (NFC). llvm-svn: 325412
* [Modules] Handle sanitizer feature mismatches when importing modulesVedant Kumar2017-06-011-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes it an error to have a mismatch between the enabled sanitizers in a CU, and in any module being imported into the CU. Only mismatches between non-modular sanitizers are treated as errors. This patch also includes non-modular sanitizers in module hashes, in order to ensure module rebuilds occur when -fsanitize=X is toggled on and off for non-modular sanitizers, and to cut down on module rebuilds when the option is toggled for modular sanitizers. This fixes a longstanding issue with implicit modules and sanitizers, which Duncan originally diagnosed. When building with implicit modules it's possible to hit a scenario where modules are built without -fsanitize=address, and are subsequently imported into CUs with -fsanitize=address enabled. This causes strange failures at runtime. The case Duncan found affects libcxx, since its vector implementation behaves differently when ASan is enabled. Implicit module builds should "just work" when -fsanitize=X is toggled on and off across multiple compiler invocations, which is what this patch does. Differential Revision: https://reviews.llvm.org/D32724 llvm-svn: 304463
* [XRay] Add -fxray-{always,never}-instrument= flags to clangDean Michael Berris2017-03-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: The -fxray-always-instrument= and -fxray-never-instrument= flags take filenames that are used to imbue the XRay instrumentation attributes using a whitelist mechanism (similar to the sanitizer special cases list). We use the same syntax and semantics as the sanitizer blacklists files in the implementation. As implemented, we respect the attributes that are already defined in the source file (i.e. those that have the [[clang::xray_{always,never}_instrument]] attributes) before applying the always/never instrument lists. Reviewers: rsmith, chandlerc Subscribers: jfb, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D30388 llvm-svn: 299041
* Do not print include_next/pragma once warnings when input is a header.Erik Verbruggen2016-10-271-1/+3
| | | | | | | | | | | r276653 suppressed the pragma once warning when generating a PCH file. This patch extends that to any main file for which clang is told (with the -x option) that it's a header file. It will also suppress the warning "#include_next in primary source file". Differential Revision: http://reviews.llvm.org/D25989 llvm-svn: 285295
* Use StringRef in LangOptions::isNoBuiltinFunc API (NFC)Mehdi Amini2016-10-101-2/+1
| | | | llvm-svn: 283776
* [modules] Flatten -fmodule-name= and -fmodule-implementation-of= into a singleRichard Smith2016-02-191-1/+0
| | | | | | | | | | | | option. Previously these options could both be used to specify that you were compiling the implementation file of a module, with a different set of minor bugs in each case. This change removes -fmodule-implementation-of, and instead tracks a flag to determine whether we're currently building a module. -fmodule-name now behaves the same way that -fmodule-implementation-of previously did. llvm-svn: 261372
* [Driver] Add support for -fno-builtin-foo options.Chad Rosier2016-01-061-0/+8
| | | | | | | Addresses PR4941 and rdar://6756912. http://reviews.llvm.org/D15195 llvm-svn: 256937
* Allow to specify multiple -fsanitize-blacklist= arguments.Alexey Samsonov2015-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Allow user to provide multiple blacklists by passing several -fsanitize-blacklist= options. These options now don't override default blacklist from Clang resource directory, which is always applied (which fixes PR22431). -fno-sanitize-blacklist option now disables all blacklists that were specified earlier in the command line (including the default one). This change depends on http://reviews.llvm.org/D7367. Test Plan: regression test suite Reviewers: timurrrr Subscribers: cfe-commits, kcc, pcc Differential Revision: http://reviews.llvm.org/D7368 llvm-svn: 228156
* [Sanitizer] Refactor sanitizer options in LangOptions.Alexey Samsonov2014-11-111-18/+1
| | | | | | | | | | | | | | | | | | Get rid of ugly SanitizerOptions class thrust into LangOptions: * Make SanitizeAddressFieldPadding a regular language option, and rely on default behavior to initialize/reset it. * Make SanitizerBlacklistFile a regular member LangOptions. * Introduce the helper class "SanitizerSet" to represent the set of enabled sanitizers and make it a member of LangOptions. It is exactly the entity we want to cache and modify in CodeGenFunction, for instance. We'd also be able to reuse SanitizerSet in CodeGenOptions for storing the set of recoverable sanitizers, and in the Driver to represent the set of sanitizers turned on/off by the commandline flags. No functionality change. llvm-svn: 221653
* Introduce a SanitizerKind enum to LangOptions.Alexey Samsonov2014-11-071-4/+11
| | | | | | | | | | | | | Use the bitmask to store the set of enabled sanitizers instead of a bitfield. On the negative side, it makes syntax for querying the set of enabled sanitizers a bit more clunky. On the positive side, we will be able to use SanitizerKind to eventually implement the new semantics for -fsanitize-recover= flag, that would allow us to make some sanitizers recoverable, and some non-recoverable. No functionality change. llvm-svn: 221558
* Get rid of SanitizerOptions::Disabled global. NFC.Alexey Samsonov2014-10-301-4/+11
| | | | | | | | | SanitizerOptions is not even a POD now, so having global variable of this type, is not nice. Instead, provide a regular constructor and clear() method, and let each CodeGenFunction has its own copy of SanitizerOptions it uses. llvm-svn: 220920
* Add stopgap option -fmodule-implementation-of <name>Ben Langmuir2014-07-231-0/+1
| | | | | | | | | | | | | | | | | | This flag specifies that we are building an implementation file of the module <name>, preventing importing <name> as a module. This does not consider this to be the 'current module' for the purposes of doing modular checks like decluse or non-modular-include warnings, unlike -fmodule-name. This is needed as a stopgap until: 1) we can resolve relative includes to a VFS-mapped module (or can safely import a header textually and as part of a module) and ideally 2) we can safely do incremental rebuilding when implementation files import submodules. llvm-svn: 213767
* Add a *San + modules FIXME.Richard Smith2013-02-071-0/+2
| | | | llvm-svn: 174565
* [ubsan] Add support for -fsanitize-blacklistWill Dietz2013-01-181-1/+7
| | | | llvm-svn: 172808
* Add a -cc1-level option -fmodule-name=<name>, which will be used whenDouglas Gregor2011-11-151-0/+2
| | | | | | building modules. llvm-svn: 144680
* Teach LangOptions::resetNonModularOptions to actually do what it says it doesDouglas Gregor2011-09-151-0/+3
| | | | llvm-svn: 139791
* When building a module on-demand, clear out the "non-modular" languageDouglas Gregor2011-09-131-0/+6
| | | | | | and preprocessor options (such as macro definitions) first. llvm-svn: 139638
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-131-0/+21
| | | | | | | | | | language options. Use that .def file to declare the LangOptions class and initialize all of its members, eliminating a source of annoying initialization bugs. AST serialization changes are next up. llvm-svn: 139605
* Remove the serialization code that predates precompiledDouglas Gregor2009-04-221-60/+0
| | | | | | | headers. Future approaches to (de-)serializing ASTs will be based on the PCH infrastructure. llvm-svn: 69828
* Add -fobjc-gc and -fobjc-gc-only options to the driver.Ted Kremenek2008-04-291-1/+3
| | | | | | Add corresponding enum in LangOptions. llvm-svn: 50387
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+58
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud