summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* [modules] Refactor handling of -fmodules-embed-*. Track this properly ratherRichard Smith2015-11-261-10/+11
| | | | | | | than reusing the "overridden buffer" mechanism. This will allow us to make embedded files and overridden files behave differently in future. llvm-svn: 254121
* [modules] Add -cc1 flag -fmodules-embed-all-files.Richard Smith2015-11-242-0/+3
| | | | | | | | | | | | | | This flag causes all files that were read by the compilation to be embedded into a produced module file. This is useful for distributed build systems that use an include scanning system to determine which files are "needed" by a compilation, and only provide those files to remote compilation workers. Since using a module can require any file that is part of that module (or anything it transitively includes), files that are not found by an include scanner can be required in a regular build using explicit modules. With this flag, only files that are actually referenced by transitively-#included files are required to be present on the build machine. llvm-svn: 253950
* Disable frame pointer elimination when using -pg Xinliang David Li2015-11-231-1/+2
| | | | | | | | | | | | | | | | (Re-apply patch after bug fixing) This diff makes sure that the driver does not pass -fomit-frame-pointer or -momit-leaf-frame-pointer to the frontend when -pg is used. Currently, clang gives an error if -fomit-frame-pointer is used in combination with -pg, but -momit-leaf-frame-pointer was forgotten. Also, disable frame pointer elimination in the frontend when -pg is set. Patch by Stefan Kempf. llvm-svn: 253886
* Revert r253846 (build bot failure))Xinliang David Li2015-11-231-2/+1
| | | | llvm-svn: 253851
* Disable frame pointer elimination when using -pgXinliang David Li2015-11-231-1/+2
| | | | | | | | | | | | | | This diff makes sure that the driver does not pass -fomit-frame-pointer or -momit-leaf-frame-pointer to the frontend when -pg is used. Currently, clang gives an error if -fomit-frame-pointer is used in combination with -pg, but -momit-leaf-frame-pointer was forgotten. Also, disable frame pointer elimination in the frontend when -pg is set. Patch by Stefan Kempf. llvm-svn: 253846
* [libclang] Make sure to use the raw module format for libclang parsing.Argyrios Kyrtzidis2015-11-201-0/+4
| | | | | | | Fixes crash when passing '-gmodules' in the compiler options. rdar://23588717 llvm-svn: 253645
* clangFrontend: [PR25565] Quick fix for dependencies on Attributes.inc.NAKAMURA Takumi2015-11-191-0/+1
| | | | | | | | FIXME: Attributes.inc may be an independent target. Differential Revision: http://reviews.llvm.org/D14760 llvm-svn: 253554
* [libclang] Add entry points that take a full command line including argv[0].Benjamin Kramer2015-11-181-4/+2
| | | | | | | | | | | | This provides both a more uniform interface and makes libclang behave like clang tooling wrt relative paths against argv[0]. This is necessary for finding paths to a c++ standard library relative to a clang binary given in a compilation database. It can also be used to find paths relative to libclang.so if the full path to it is passed in. Differential Revision: http://reviews.llvm.org/D14695 llvm-svn: 253466
* [CUDA] Make CUDA compilation usable by default.Artem Belevich2015-11-171-0/+2
| | | | | | | | | | | | | | | | | | Currently clang requires several additional command line options in order to enable new features needed during CUDA compilation. This patch makes these options default. * Automatically include cuda_runtime.h if we've found a valid CUDA installation. * Disable automatic CUDA header inclusion during unit tests. * Added test case for command line construction. * Enabled target overloads and relaxed call checks that are needed in order to include CUDA headers. * Added CUDA-7.5 installation path to the CUDA installation search list. * Define __CUDA__ macro to indicate CUDA compilation. llvm-svn: 253389
* Revert "Make FP_CONTRACT ON the default."Manuel Klimek2015-11-171-0/+1
| | | | | | | | | This reverts commit r253269. This leads to assert / segfault triggering on the following reduced example: float foo(float U, float base, float cell) { return (U = 2 * base) - cell; } llvm-svn: 253337
* Make FP_CONTRACT ON the default.Stephen Canon2015-11-161-1/+0
| | | | | | Differential Revision: D14200 llvm-svn: 253269
* [Frontend] Rangify for loop. NFC.Vedant Kumar2015-11-161-2/+2
| | | | llvm-svn: 253178
* Revert r240335.Richard Smith2015-11-121-2/+0
| | | | | | | | | | | | | | | This failed to solve the problem it was aimed at, and introduced just as many issues as it resolved. Realistically, we need to deal with the possibility that multiple modules might define different internal linkage symbols with the same name, and this isn't a problem unless two such symbols are simultaneously visible. The case where two modules define equivalent internal linkage symbols is handled by r252063: if lookup finds multiple sufficiently-similar entities from different modules, we just pick one of them as an extension (but we keep them separate). llvm-svn: 252957
* Define __unsafe_unretained and __autoreleasing in ObjC GC mode.John McCall2015-11-101-0/+2
| | | | | | This was an accidental regression from the MRC __weak patch. llvm-svn: 252668
* Moving FileManager::removeDotPaths to llvm::sys::path::remove_dotsMike Aizatsky2015-11-091-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D14394 llvm-svn: 252501
* [EABI] Add Clang support for -meabi flagRenato Golin2015-11-091-0/+15
| | | | | | | | | | | | | | The -meabi flag to control LLVM EABI version. Without '-meabi' or with '-meabi default' imply LLVM triple default. With '-meabi gnu' sets EABI GNU. With '-meabi 4' or '-meabi 5' set EABI version 4 and 5 respectively. A similar patch was introduced in LLVM. Patch by Vinicius Tinti. llvm-svn: 252463
* After some discussion, promote -fobjc-weak to a driver option.John McCall2015-11-051-7/+10
| | | | | | rdar://problem/23415863 llvm-svn: 252187
* TestModuleFileExtension.cpp: Include <cstdio> explicitly for fprintf(3).NAKAMURA Takumi2015-11-051-0/+1
| | | | llvm-svn: 252128
* [modules] If we're given a module file, via -fmodule-file=, for a module, butRichard Smith2015-11-051-4/+24
| | | | | | | | | we can't load that file due to a configuration mismatch, and implicit module building is disabled, and the user turns off the error-by-default warning for that situation, then fall back to textual inclusion for the module rather than giving an error if any of its headers are included. llvm-svn: 252114
* Introduce module file extensions to piggy-back data onto module files.Douglas Gregor2015-11-038-14/+287
| | | | | | | | | | | | | | | | | | | | | Introduce the notion of a module file extension, which introduces additional information into a module file at the time it is built that can then be queried when the module file is read. Module file extensions are identified by a block name (which must be unique to the extension) and can write any bitstream records into their own extension block within the module file. When a module file is loaded, any extension blocks are matched up with module file extension readers, that are per-module-file and are given access to the input bitstream. Note that module file extensions can only be introduced by programmatic clients that have access to the CompilerInvocation. There is only one such extension at the moment, which is used for testing the module file extension harness. As a future direction, one could imagine allowing the plugin mechanism to introduce new module file extensions. llvm-svn: 251955
* Stop back-patching 'readonly' Objective-C properties with 'readwrite' ones.Douglas Gregor2015-11-031-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | A 'readonly' Objective-C property declared in the primary class can effectively be shadowed by a 'readwrite' property declared within an extension of that class, so long as the types and attributes of the two property declarations are compatible. Previously, this functionality was implemented by back-patching the original 'readonly' property to make it 'readwrite', destroying source information and causing some hideously redundant, incorrect code. Simplify the implementation to express how this should actually be modeled: as a separate property declaration in the extension that shadows (via the name lookup rules) the declaration in the primary class. While here, correct some broken Fix-Its, eliminate a pile of redundant code, clean up the ARC migrator's handling of properties declared in extensions, and fix debug info's naming of methods that come from categories. A wonderous side effect of doing this write is that it eliminates the "AddedObjCPropertyInClassExtension" method from the AST mutation listener, which in turn eliminates the last place where we rewrite entire declarations in a chained PCH file or a module file. This change (which fixes rdar://problem/18475765) will allow us to eliminate the rewritten-decls logic from the serialization library, and fixes a crash (rdar://problem/23247794) illustrated by the test/PCH/chain-categories.m example. llvm-svn: 251874
* [PTH] Fix data length used for stat cache entriesReid Kleckner2015-11-021-1/+1
| | | | | | | | | | | | | | This came up in a boost build, which apparently uses PTH. This was broken in r187619 when we migrated it to uses llvm::fs instead of raw stat calls. Constructing a test case with a hash table collision in-tree is tough. Instead, I have a pending change to OnDiskChainedHashTable that asserts that the reported length of the data agrees with the data actually written. All of the existing in-tree tests find the bug with this assert. llvm-svn: 251828
* Sink some PTHManager includes out of Preprocessor.hReid Kleckner2015-11-022-0/+2
| | | | | | | This reduces the number of .cpp files needed to be rebuilt after touching OnDiskHashTable from 120 to 21 for me. llvm-svn: 251810
* Allow linking multiple bitcode files.Artem Belevich2015-10-271-4/+8
| | | | | | | | | | | | | | | | | | Linking options for particular file depend on the option that specifies the file. Currently there are two: * -mlink-bitcode-file links in complete content of the specified file. * -mlink-cuda-bitcode links in only the symbols needed by current TU. Linked symbols are internalized. This bitcode linking mode is used to link device-specific bitcode provided by CUDA. Files are linked in order they are specified on command line. -mlink-cuda-bitcode replaces -fcuda-uses-libdevice flag. Differential Revision: http://reviews.llvm.org/D13913 llvm-svn: 251427
* Define weak and __weak to mean ARC-style weak references, even in MRC.John McCall2015-10-222-26/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, __weak was silently accepted and ignored in MRC mode. That makes this a potentially source-breaking change that we have to roll out cautiously. Accordingly, for the time being, actual support for __weak references in MRC is experimental, and the compiler will reject attempts to actually form such references. The intent is to eventually enable the feature by default in all non-GC modes. (It is, of course, incompatible with ObjC GC's interpretation of __weak.) If you like, you can enable this feature with -Xclang -fobjc-weak but like any -Xclang option, this option may be removed at any point, e.g. if/when it is eventually enabled by default. This patch also enables the use of the ARC __unsafe_unretained qualifier in MRC. Unlike __weak, this is being enabled immediately. Since variables are essentially __unsafe_unretained by default in MRC, the only practical uses are (1) communication and (2) changing the default behavior of by-value block capture. As an implementation matter, this means that the ObjC ownership qualifiers may appear in any ObjC language mode, and so this patch removes a number of checks for getLangOpts().ObjCAutoRefCount that were guarding the processing of these qualifiers. I don't expect this to be a significant drain on performance; it may even be faster to just check for these qualifiers directly on a type (since it's probably in a register anyway) than to do N dependent loads to grab the LangOptions. rdar://9674298 llvm-svn: 251041
* [coroutines] Add feature-test macro for coroutines, defined to 1 to indicateRichard Smith2015-10-221-0/+2
| | | | | | the implementation is incomplete. llvm-svn: 250982
* [coroutines] Add lexer support for co_await, co_yield, and co_return keywords.Richard Smith2015-10-221-0/+1
| | | | | | | Add -fcoroutines flag (just for -cc1 for now) to enable the feature. Early indications are that this will be part of -std=c++1z. llvm-svn: 250980
* Fix a couple places where InsertText was being called with a pointer and ↵Craig Topper2015-10-222-5/+5
| | | | | | | | size when it really expects a StringRef and a normally optional bool argument. The pointer was being implicitly converted to a StringRef and the size was being passed into the bool. Since the bool has a default value normally, no one noticed that the wrong number of arguments was given. llvm-svn: 250977
* Pass an ArrayRef instead of pointer and size. NFCCraig Topper2015-10-222-68/+38
| | | | llvm-svn: 250976
* [Driver] Alias -fvisibility=internal to -fvisibility=hiddenReid Kleckner2015-10-211-1/+1
| | | | | | | | | | | | | | | | | | The ELF symbol visibilities are: - internal: Not visibile across DSOs, cannot pass address across DSOs - hidden: Not visibile across DSOs, can be called indirectly - default: Usually visible across DSOs, possibly interposable - protected: Visible across DSOs, not interposable LLVM only supports the latter 3 visibilities. Internal visibility is in theory useful, as it allows you to assume that the caller is maintaining a PIC register for you in %ebx, or in some other pre-arranged location. As far as LLVM is concerned, this isn't worth the trouble. Using hidden visibility is always correct, so we can just do that. Resolves PR9183. llvm-svn: 250954
* Roll-back r250822.Angel Garcia Gomez2015-10-2013-17/+17
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 llvm-svn: 250827
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-2013-17/+17
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 llvm-svn: 250822
* [Frontend] Name variable correctly.Davide Italiano2015-10-171-2/+2
| | | | | | Reported by: Kim Grasman! llvm-svn: 250605
* [modules] Allow the error when explicitly loading an incompatible module fileRichard Smith2015-10-161-5/+14
| | | | | | | | | via -fmodule-file= to be turned off; in that case, just include the relevant files textually. This allows module files to be unconditionally passed to all compile actions via CXXFLAGS, and to be ignored for rules that specify custom incompatible flags. llvm-svn: 250577
* [Frontend/CompilerInvocation] Use range-based loop. NFC.Davide Italiano2015-10-161-2/+2
| | | | llvm-svn: 250559
* Refactor module lookup when looking up a header file, and wire through the ↵Richard Smith2015-10-161-1/+2
| | | | | | requesting module. No functionality change. llvm-svn: 250554
* Recommit "Clang support for -flto=thin."Teresa Johnson2015-10-151-1/+3
| | | | | | | | | This recommits r250398 with fixes to the tests for bot failures. Add "-target x86_64-unknown-linux" to the clang invocations that check for the gold plugin. llvm-svn: 250455
* Revert "Clang support for -flto=thin." (bot failures)Teresa Johnson2015-10-151-3/+1
| | | | | | | | | | | Rolling this back for now since there are a couple of bot failures on the new tests I added, and I won't have a chance to look at them in detail until later this afternoon. I think the new tests need some restrictions on having the gold plugin available. This reverts commit r250398. llvm-svn: 250402
* Clang support for -flto=thin.Teresa Johnson2015-10-151-1/+3
| | | | | | | | | | | | | | | | | | | Summary: Add clang support for -flto=thin option, which is used to set the EmitFunctionSummary code gen option on compiles. Add -flto=full as an alias to the existing -flto. Add tests to check for proper overriding of -flto variants on the command line, and convert grep tests to FileCheck. Reviewers: dexonsmith, joker.eph Subscribers: davidxl, cfe-commits Differential Revision: http://reviews.llvm.org/D11908 llvm-svn: 250398
* Bring back r250262: PS4 toolchainFilipe Cabecinhas2015-10-141-0/+23
| | | | | | | | | | | | | | There was a minor problem with a test. Sorry for the noise yesterday. This patch adds missing pieces to clang, including the PS4 toolchain definition, added warnings, PS4 defaults, and Driver changes needed for our compiler. A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova! Differential Revision: http://reviews.llvm.org/D13482 llvm-svn: 250293
* Revert-to-green r250262 (PS4 toolchain patch)Sean Silva2015-10-141-23/+0
| | | | | | | It is breaking llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast e.g. http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/1362 llvm-svn: 250273
* I took care of the build problem in the commit 250252.Ekaterina Romanova2015-10-141-0/+23
| | | | | | | | | | | | | | Resubmitting the patch. This patch adds missing pieces to clang, including the PS4 toolchain definition, added warnings, PS4 defaults, and Driver changes needed for our compiler. A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova! Differential Revision: http://reviews.llvm.org/D13482 llvm-svn: 250262
* reverting my patch, cause build problemsEkaterina Romanova2015-10-141-23/+0
| | | | llvm-svn: 250257
* This patch adds missing pieces to clang, including the PS4 toolchainEkaterina Romanova2015-10-131-0/+23
| | | | | | | | | | | definition, added warnings, PS4 defaults, and Driver changes needed for our compiler. A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova! Differential Revision: http://reviews.llvm.org/D13482 llvm-svn: 250252
* Support Debug Info path remappingSaleem Abdulrasool2015-10-121-0/+3
| | | | | | | | | | | | | | | | Add support for the `-fdebug-prefix-map=` option as in GCC. The syntax is `-fdebug-prefix-map=OLD=NEW`. When compiling files from a path beginning with OLD, change the debug info to indicate the path as start with NEW. This is particularly helpful if you are preprocessing in one path and compiling in another (e.g. for a build cluster with distcc). Note that the linearity of the implementation is not as terrible as it may seem. This is normally done once per file with an expectation that the map will be small (1-2) entries, making this roughly linear in the number of input paths. Addresses PR24619. llvm-svn: 250094
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-081-29/+9
| | | | | | | | | | | | | | | | With this change, most 'g' options are rejected by CompilerInvocation. They remain only as Driver options. The new way to request debug info from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}" and "-dwarf-version={2|3|4}". In the absence of a command-line option to specify Dwarf version, the Toolchain decides it, rather than placing Toolchain-specific logic in CompilerInvocation. Also fix a bug in the Windows compatibility argument parsing in which the "rightmost argument wins" principle failed. Differential Revision: http://reviews.llvm.org/D13221 llvm-svn: 249655
* [WinEH] Remove NewMSEH and enable its behavior by defaultReid Kleckner2015-10-081-1/+0
| | | | | | | Testing has shown that it is at least as reliable as the old landingpad pattern matching code. llvm-svn: 249647
* Fix Clang-tidy modernize-use-nullptr warnings in source directories; other ↵Hans Wennborg2015-10-061-6/+6
| | | | | | | | | | minor cleanups Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13406 llvm-svn: 249484
* [Tooling] Reuse FileManager in ASTUnit.Benjamin Kramer2015-10-061-13/+9
| | | | | | | | ASTUnit was creating multiple FileManagers and throwing them away. Reuse the one from Tooling. No functionality change now but necessary for VFSifying tooling. llvm-svn: 249410
* Use llvm::errc instead of std::errc.Rafael Espindola2015-10-051-1/+1
| | | | llvm-svn: 249302
OpenPOWER on IntegriCloud