summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Insert random noops to increase security against ROP attacks (clang)JF Bastien2015-01-141-0/+1
| | | | | | | | | | | | | | | | | | | | A pass that adds random noops to X86 binaries to introduce diversity with the goal of increasing security against most return-oriented programming attacks. Command line options: -noop-insertion // Enable noop insertion. -noop-insertion-percentage=X // X% of assembly instructions will have a noop prepended (default: 50%, requires -noop-insertion) -max-noops-per-instruction=X // Randomly generate X noops per instruction. ie. roll the dice X times with probability set above (default: 1). This doesn't guarantee X noop instructions. In addition, the following 'quick switch' in clang enables basic diversity using default settings (currently: noop insertion and schedule randomization; it is intended to be extended in the future). -fdiversify This is the clang part of the patch. llvm part: D3392 http://reviews.llvm.org/D3393 Patch by Stephen Crane (@rinon) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225910 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement -fsanitize-recover family of flags.Alexey Samsonov2015-01-121-13/+23
| | | | | | | | | | | | | | | | | | | | | | | | Introduce the following -fsanitize-recover flags: - -fsanitize-recover=<list>: Enable recovery for selected checks or group of checks. It is forbidden to explicitly list unrecoverable sanitizers here (that is, "address", "unreachable", "return"). - -fno-sanitize-recover=<list>: Disable recovery for selected checks or group of checks. - -f(no-)?sanitize-recover is now a synonym for -f(no-)?sanitize-recover=undefined,integer and will soon be deprecated. These flags are parsed left to right, and mask of "recoverable" sanitizer is updated accordingly, much like what we do for -fsanitize= flags. -fsanitize= and -fsanitize-recover= flag families are independent. CodeGen change: If there is a single UBSan handler function, responsible for implementing multiple checks, which have different recoverable setting, then we emit two handler calls instead of one: the first one for the set of "unrecoverable" checks, another one - for set of "recoverable" checks. If all checks implemented by a handler have the same recoverability setting, then the generated code will be the same. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225719 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: begin threading frontend support for SymbolRewriterSaleem Abdulrasool2015-01-091-0/+2
| | | | | | | | | | Allow blessed access to the symbol rewriter from the driver. Although the symbol rewriter could be invoked through tools like opt and llc, it would not accessible from the frontend. This allows us to read the rewrite map files in the frontend rather than the backend and enable symbol rewriting for actually performing the symbol interpositioning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225504 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix use-after-destruction introduced in r224924.Alexey Samsonov2014-12-291-1/+2
| | | | | | | | getMainExecutable() returns a std::string, assigning its result to StringRef immediately creates a dangling pointer. This was detected by half-broken fast-MSan-bootstrap bot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224956 91177308-0d34-0410-b5e6-96231b3b80d8
* [multilib] Teach Clang's code about multilib by threadingChandler Carruth2014-12-291-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a CLANG_LIBDIR_SUFFIX down from the build system and using that as part of the default resource dir computation. Without this, essentially nothing that uses the clang driver works when building clang with a libdir suffix. This is probably the single biggest missing piece of support for multilib as without this people could hack clang to end up installed in the correct location, but it would then fail to find its own basic resources. I know of at least one distro that has some variation on this patch to hack around this; hopefully they'll be able to use the libdir suffix functionality directly as the rest of these bits land. This required fixing a copy of the code to compute Clang's resource directory that is buried inside of the frontend (!!!). It had bitrotted significantly relative to the driver code. I've made it essentially a clone of the driver code in order to keep tests (which use cc1 heavily) passing. This copy should probably just be removed and the frontend taught to always rely on an explicit resource directory from the driver, but that is a much more invasive change for another day. I've also updated one test which actually encoded the resource directory in its checked output to tolerate multilib suffixes. Note that this relies on a prior LLVM commit to add a stub to the autoconf build system for this variable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224924 91177308-0d34-0410-b5e6-96231b3b80d8
* Add driver flags -ftrigraphs, -fno-trigraphs.Nico Weber2014-12-231-2/+2
| | | | | | | | | | | | | | | | | | -trigraphs is now an alias for -ftrigraphs. -fno-trigraphs makes it possible to explicitly disable trigraphs, which couldn't be done before. clang -std=c++11 -fno-trigraphs now builds without GNU extensions, but with trigraphs disabled. Previously, trigraphs were only disabled in GNU modes or with -std=c++1z. Make the new -f flags the cc1 interface too. This requires changing -trigraphs to -ftrigraphs in a few cc1 tests. Related to PR21974. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224790 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable trigraphs in microsoft mode by default. Matches cl.exe.Nico Weber2014-12-221-9/+9
| | | | | | | | | | | The default value of Opts.Trigraphs now no longer depends solely on the language input kind, so move the code out of setLangDefaults(). Also make sure that Opts.MSVCCompat is set before the Trigraph code runs. Related to PR21974. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224719 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix handling of invalid -O options.Rafael Espindola2014-12-161-4/+6
| | | | | | | | We were checking the value after truncating it to a bitfield. Thanks to Yunzhong Gao for noticing it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224378 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new flag, -fspell-checking-limit=<number> to control how many times ↵Nick Lewycky2014-12-161-0/+3
| | | | | | | | | we'll do spell checking. Note that spell checking will change the produced AST, so we don't automatically change this value when someone sets -ferror-limit=. With this, merge test typo-correction-pt2.cpp into typo-correction.cpp. Remove Sema::UnqualifiedTyposCorrected, a cache of corrected typos. It would only cache typo corrections that didn't provide ValidateCandidate of which there were few left, and it had a bug when we had the same identifier spelled wrong twice. See the last two tests in typo-correction.cpp for cases this fires. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224375 91177308-0d34-0410-b5e6-96231b3b80d8
* OpenCL C: Add support for a set of floating point Pekka Jaaskelainen2014-12-101-4/+9
| | | | | | | | | | | | | | | | arithmetic relaxation flags: -cl-no-signed-zeros -cl-unsafe-math-optimizations -cl-finite-math-only -cl-fast-relaxed-math Propagate the info to FP instruction flags as well as function attributes where they are available. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223928 91177308-0d34-0410-b5e6-96231b3b80d8
* Reinstate r223753, reverted in r223759 due to breakage of clang-tools-extra.Richard Smith2014-12-101-0/+1
| | | | | | | | | | | | | | | | | | Original commit message: [modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1. For files named by -fmodule-map-file=, and files found by 'extern module' directives, this flag specifies that we should resolve filenames relative to the current working directory rather than relative to the directory in which the module map file resides. This is aimed at fixing path handling, in particular for relative -I paths, when building modules that represent components of the current project (rather than libraries installed on the current system, which the current project has as dependencies, where we'd typically expect the module map files to be looked up implicitly). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223913 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1."Duncan P. N. Exon Smith2014-12-091-1/+0
| | | | | | | | | | | | | This reverts commit r223753. It broke the Green Dragon build for a few hours: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/2259/ http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/2259/consoleFull#43901905849ba4694-19c4-4d7e-bec5-911270d8a58c I suspect `clang-tools-extra` just needs a follow-up for an API change, but I'm not the right one to look into it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223759 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1.Richard Smith2014-12-091-0/+1
| | | | | | | | | | | | | | For files named by -fmodule-map-file=, and files found by 'extern module' directives, this flag specifies that we should resolve filenames relative to the current working directory rather than relative to the directory in which the module map file resides. This is aimed at fixing path handling, in particular for relative -I paths, when building modules that represent components of the current project (rather than libraries installed on the current system, which the current project has as dependencies, where we'd typically expect the module map files to be looked up implicitly). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223753 91177308-0d34-0410-b5e6-96231b3b80d8
* PR21217: Slightly more eagerly load -fmodule-map-file= files and provideRichard Smith2014-12-061-3/+1
| | | | | | | diagnostics if they don't exist. Based on a patch by John Thompson! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223561 91177308-0d34-0410-b5e6-96231b3b80d8
* CUDA host device code with two code pathsReid Kleckner2014-12-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: Allow CUDA host device functions with two code paths using __CUDA_ARCH__ to differentiate between code path being compiled. For example: __host__ __device__ void host_device_function(void) { #ifdef __CUDA_ARCH__ device_only_function(); #else host_only_function(); #endif } Patch by Jacques Pienaar. Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D6457 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223271 91177308-0d34-0410-b5e6-96231b3b80d8
* Add flag -f(no-)modules-implicit-maps.Daniel Jasper2014-11-251-0/+2
| | | | | | | This suppresses the implicit search for files called 'module.modulemap' and similar. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222745 91177308-0d34-0410-b5e6-96231b3b80d8
* Extended list of valid frontend options with '-cl-std=CL2.0'.Anastasia Stulova2014-11-201-2/+5
| | | | | | | | | | This option sets language mode for the compilation of a source file to be OpenCL v2.0. Example: clang -cc1 -cl-std=CL2.0 myfile.cl git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222444 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove -fseh-exceptions in favor of checking the tripleReid Kleckner2014-11-141-1/+0
| | | | | | | | | This option was misleading because it looked like it enabled the language feature of SEH (__try / __except), when this option was really controlling which EH personality function to use. Mingw only supports SEH and SjLj EH on x86_64, so we can simply do away with this flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221963 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce -fsanitize-coverage=N flagKostya Serebryany2014-11-111-0/+2
| | | | | | | | | | | | | | | | | | | Summary: This change makes the asan-coverge (formerly -mllvm -asan-coverge) accessible via a clang flag. Companion patch to LLVM is http://reviews.llvm.org/D6152 Test Plan: regression tests, chromium Reviewers: samsonov Reviewed By: samsonov Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6153 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221719 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Refactor sanitizer options in LangOptions.Alexey Samsonov2014-11-111-2/+2
| | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221653 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a SanitizerKind enum to LangOptions.Alexey Samsonov2014-11-071-25/+8
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221558 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C SDK modernization tool. Use its own optionFariborz Jahanian2014-10-311-0/+2
| | | | | | | | | ,-objcmt-migrate-property-dot-syntax, when migarting to use property-dot syntax in place of messaging expression. rdar://18839124 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221001 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new -fmerge-functions -cc1 flag that enables function merging.Nick Lewycky2014-10-241-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220543 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: Include driver diagnostics when we --serialize-diagnosticsJustin Bogner2014-10-231-2/+3
| | | | | | | | | | | | | | | Currently, when --serialize-diagnostics is passed this only includes the diagnostics from clang -cc1, and driver diagnostics are dropped. This causes issues for tools that use the serialized diagnostics, since stderr is lost and these diagnostics aren't seen at all. We handle this by merging the diagnostics from the CC1 process and the driver diagnostics into a single file when the driver invokes CC1. Fixes rdar://problem/10585062 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220525 91177308-0d34-0410-b5e6-96231b3b80d8
* Support using sample profiles with partial debug info (driver)Diego Novillo2014-10-221-2/+8
| | | | | | | | | | | | | | | | | | | | | | | Summary: When using a profile, we used to require the use -gmlt so that we could get access to the line locations. This is used to match line numbers in the input profile to the line numbers in the function's IR. But this is actually not necessary. The driver can provide source location tracking without the emission of debug information. In these cases, the annotation 'llvm.dbg.cu' is missing from the IR, but the actual line location annotations are still present. This patch tells the driver to only emit source location tracking when -fprofile-sample-use is present in the command line. Reviewers: echristo, dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5888 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220383 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Initial support for explicitly loading .pcm files.Richard Smith2014-10-221-1/+2
| | | | | | | | | | | | | | | | Implicit module builds are not well-suited to a lot of build systems. In particular, they fare badly in distributed build systems, and they lead to build artifacts that are not tracked as part of the usual dependency management process. This change allows explicitly-built module files (which are already supported through the -emit-module flag) to be explicitly loaded into a build, allowing build systems to opt to manage module builds and dependencies themselves. This is only the first step in supporting such configurations, and it should be considered experimental and subject to change or removal for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220359 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch C compilations to C11 by default.Richard Smith2014-10-201-1/+1
| | | | | | | | | This is long-since overdue, and matches GCC 5.0. This should also be backwards-compatible, because we already supported all of C11 as an extension in C99 mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220244 91177308-0d34-0410-b5e6-96231b3b80d8
* Move -fsanitize-blacklist to LangOpts from CodeGenOpts. NFC.Alexey Samsonov2014-10-151-1/+1
| | | | | | | | | After http://reviews.llvm.org/D5687 is submitted, we will need SanitizerBlacklist before the CodeGen phase, so make it a LangOpt (as it will actually affect ABI / class layout). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219842 91177308-0d34-0410-b5e6-96231b3b80d8
* Add experimental clang/driver flag -fsanitize-address-field-padding=NKostya Serebryany2014-10-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: This change adds an experimental flag -fsanitize-address-field-padding=N (0, 1, 2) to clang and driver. With this flag ASAN will be able to detect some cases of intra-object-overflow bugs, see https://code.google.com/p/address-sanitizer/wiki/IntraObjectOverflow There is no actual functionality here yet, just the flag parsing. The functionality is being reviewed at http://reviews.llvm.org/D5687 Test Plan: Build and run SPEC, LLVM Bootstrap, Chrome with this flag. Reviewers: samsonov Reviewed By: samsonov Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5676 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219417 91177308-0d34-0410-b5e6-96231b3b80d8
* CFE Knob for: Add a thread-model knob for lowering atomics on baremetal & ↵Jonathan Roelofs2014-10-031-0/+5
| | | | | | | | | single threaded systems http://reviews.llvm.org/D4985 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219027 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -fseh-exceptions for MinGW-w64Reid Kleckner2014-09-151-0/+1
| | | | | | | | | | | | | | This adds a flag called -fseh-exceptions that uses the native Windows .pdata and .xdata unwind mechanism to throw exceptions. The other EH possibilities are DWARF and SJLJ exceptions. Patch by Martell Malone! Reviewed By: asl, rnk Differential Revision: http://reviews.llvm.org/D3419 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217790 91177308-0d34-0410-b5e6-96231b3b80d8
* Frontend: Reindent Opts.CoverageFileDavid Majnemer2014-09-011-1/+1
| | | | | | No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216888 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an option to silence all analyzer warnings.Anna Zaks2014-08-291-0/+2
| | | | | | | | | | | | People have been incorrectly using "-analyzer-disable-checker" to silence analyzer warnings on a file, when analyzing a project. Add the "-analyzer-disable-all-checks" option, which would allow the suppression and suggest it as part of the error message for "-analyzer-disable-checker". The idea here is to compose this with "--analyze" so that users can selectively opt out specific files from static analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216763 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow __fp16 as a function arg or return type for AArch64Oliver Stannard2014-08-271-0/+2
| | | | | | | | | | | | | ACLE 2.0 allows __fp16 to be used as a function argument or return type. This enables this for AArch64. This also fixes an existing bug that causes clang to not allow homogeneous floating-point aggregates with a base type of __fp16. This is valid for AAPCS64, but not for AAPCS-VFP. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216558 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert MC command line flag for fatal assembler warnings into a properJoerg Sonnenberger2014-08-261-0/+1
| | | | | | | flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216472 91177308-0d34-0410-b5e6-96231b3b80d8
* C++1y is now C++14!Aaron Ballman2014-08-191-3/+3
| | | | | | Changes diagnostic options, language standard options, diagnostic identifiers, diagnostic wording to use c++14 instead of c++1y. It also modifies related test cases to use the updated diagnostic wording. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215982 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert a few ownership comments with std::unique_ptr.Rafael Espindola2014-08-171-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215853 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify behavior of -ast-dump-lookups: if -ast-dump is not also provided, dumpRichard Smith2014-08-111-0/+2
| | | | | | | | | anyway. If -ast-dump *is* also provided, then dump the AST declarations as well as the lookup results. This is invaluable for cross-correlating the lookup information with the declarations actually found. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215393 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a cc1 "dump-coverage-mapping" for testing coverage mapping.Alex Lorenz2014-08-081-0/+1
| | | | | | | Differential Revision: http://reviews.llvm.org/D4799 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215258 91177308-0d34-0410-b5e6-96231b3b80d8
* Use -Rblah, not -Wblah, to control remark diagnostics. This was always theRichard Smith2014-08-071-18/+15
| | | | | | | | | | | | | | | | | | | | | | | intent when we added remark support, but was never implemented in the general case, because the first -R flags didn't need it. (-Rpass= had special handling to accomodate its argument.) -Rno-foo, -Reverything, and -Rno-everything can be used to turn off a remark, or to turn on or off all remarks. Per discussion on cfe-commits, -Weverything does not affect remarks, and -Reverything does not affect warnings or errors. The only "real" -R flag we have right now is -Rmodule-build; that flag is effectively renamed from -Wmodule-build to -Rmodule-build by this change. -Wpass and -Wno-pass (and their friends) are also renamed to -Rpass and -Rno-pass by this change; it's not completely clear whether we intended to have a -Rpass (with no =pattern), but that is unchanged by this commit, other than the flag name. The default pattern is effectively one which matches no passes. In future, we may want to make the default pattern be .*, so that -Reverything works for -Rpass properly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215046 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce f[no-]max-unknown-pointer-align=[number] optionFariborz Jahanian2014-08-051-0/+1
| | | | | | | | | | to instruct the code generator to not enforce a higher alignment than the given number (of bytes) when accessing memory via an opaque pointer or reference. Patch reviewed by John McCall (with post-commit review pending). rdar://16254558 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214911 91177308-0d34-0410-b5e6-96231b3b80d8
* Add coverage mapping generation.Alex Lorenz2014-08-041-0/+1
| | | | | | | | | | | This patch adds the '-fcoverage-mapping' option which allows clang to generate the coverage mapping information that can be used to provide code coverage analysis using the execution counts obtained from the instrumentation based profiling (-fprofile-instr-generate). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214752 91177308-0d34-0410-b5e6-96231b3b80d8
* Add stopgap option -fmodule-implementation-of <name>Ben Langmuir2014-07-231-0/+8
| | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213767 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: bifurcate extended and basic MSC versioningSaleem Abdulrasool2014-07-161-20/+3
| | | | | | | | | | | | | | | | | | | | | | | This restores the original behaviour of -fmsc-version. The older option remains as a mechanism for specifying the basic version information. A secondary option, -fms-compatibility-version permits the user to specify an extended version to the driver. The new version takes the value as a dot-separated value rather than the major * 100 + minor format that -fmsc-version format. This makes it easier to specify the value as well as a more flexible manner for specifying the value. Specifying both values is considered an error. The older parameter is left solely as a driver option, which is normalised into the newer parameter. This allows us to retain a single code path in the compiler itself whilst preserving the semantics of the old parameter as well as avoid having to determine which of two formats are being used by the invocation. The test changes are due to the fact that the compiler no longer supports the old option, and is a direct conversion to the new option. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213119 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for llvm api change.Rafael Espindola2014-07-061-5/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212408 91177308-0d34-0410-b5e6-96231b3b80d8
* Track IntrusiveRefCntPtr::get() changes from LLVM r212366Alp Toker2014-07-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212369 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: Handle /GR- in a compatible way with MSVCDavid Majnemer2014-07-011-0/+1
| | | | | | | | | | | | | | | | | There are slight differences between /GR- and -fno-rtti which made mapping one to the other inappropriate. -fno-rtti disables dynamic_cast, typeid, and does not emit RTTI related information for the v-table. /GR- does not generate complete object locators and thus will not reference them in vftables. However, constructs like dynamic_cast and typeid are permitted. This should bring our implementation of RTTI up to semantic parity with MSVC modulo bugs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212138 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new debug kind LocTrackingOnly.Diego Novillo2014-06-241-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This new debug emission kind supports emitting line location information in all instructions, but stops code generation from emitting debug info to the final output. This mode is useful when the backend wants to track source locations during code generation, but it does not want to produce debug info. This is currently used by optimization remarks (-Rpass, -Rpass-missed and -Rpass-analysis). When one of the -Rpass flags is used, the front end will enable location tracking, only if no other debug option is enabled. To prevent debug information from being generated, a new debug info kind LocTrackingOnly causes DIBuilder::createCompileUnit() to not emit the llvm.dbg.cu annotation. This blocks final code generation from generating debug info in the back end. Depends on D4234. Reviewers: echristo, dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4235 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211610 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: correct behaviour of -fmsc-version=MAJORSaleem Abdulrasool2014-06-231-1/+5
| | | | | | | | | Ensure that we properly handle the case where just the major version component is provided by the user. Thanks to Alp Toker for pointing out that this was not handled correctly! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211506 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: enhance MSC version compatibilitySaleem Abdulrasool2014-06-201-1/+52
| | | | | | | | | | | | | | | | | | | | | | | | | The version information for Visual Studio is spread over multiple variables. The newer Windows SDK has started making use of some of the extended versioning variables that were previously undefined. Enhance our compatibility definitions for these cases. _MSC_VER is defined to be the Major * 100 + Minor. _MSC_FULL_VER is defined to be Major * 10000000 + Minor * 100000 + Build. And _MSC_BUILD is the build revision of the compiler. Extend the -fmsc-version option in a compatible manner. If the value is the previous form of MMmm, then we assume that the build number is 0. Otherwise, a specific build number may be passed by using the form MMmmbbbbb. Due to bitwidth limitations of the option, it is currently not possible to define a revision value. The version information can be passed as either the decimal encoded value (_MSC_FULL_VER or _MSC_VER) or as a dot-delimited value. The change to the TextDiagnostic is to deal with the updated encoding of the version information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211420 91177308-0d34-0410-b5e6-96231b3b80d8