summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove unnecessary ClangLibdirSuffix variable. Yaron Keren2015-08-051-6/+4
| | | | | | Twine + const char * is supported. llvm-svn: 244110
* Add -gcodeview and -gdwarf to control which type Clang emitsReid Kleckner2015-08-051-3/+7
| | | | | | | | | | | | | | | Summary: By default, 'clang' emits dwarf and 'clang-cl' emits codeview. You can force emission of one or both by passing -gcodeview and -gdwarf to either driver. Reviewers: dblaikie, hans Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11742 llvm-svn: 244097
* Delete trailing whitespaceDouglas Katzman2015-08-051-16/+16
| | | | llvm-svn: 244051
* [MS ABI] Hook clang up to the new EH instructionsDavid Majnemer2015-07-311-0/+1
| | | | | | | | | | The new EH instructions make it possible for LLVM to generate .xdata tables that the MSVC personality routines will be happy about. Because this is experimental, hide it behind a -cc1 flag (-fnew-ms-eh). Differential Revision: http://reviews.llvm.org/D11405 llvm-svn: 243767
* Add support for System z vector language extensionsUlrich Weigand2015-07-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The z13 vector facility has an associated language extension, closely modeled on AltiVec/VSX. The main differences are: - vector long, vector float and vector pixel are not supported - vector long long and vector double are supported (like VSX) - comparison operators return a vector rather than a scalar integer - shift operators behave like the OpenCL shift operators - vector bool is only supported as argument to certain operators; some operators allow mixing a bool with a non-bool vector This patch adds clang support for the extension. It is closely modelled on the AltiVec support. Similarly to the -faltivec option, there's a new -fzvector option to enable the extensions (as well as an -mzvector alias for compatibility with GCC). There's also a separate LangOpt. The extension as implemented here is intended to be compatible with the -mzvector extension recently implemented by GCC. Based on a patch by Richard Sandiford. Differential Revision: http://reviews.llvm.org/D11001 llvm-svn: 243642
* Use an iterative method instead of recursion for printing macro backtraces.Richard Trieu2015-07-281-54/+63
| | | | | | | | | | | | Store the locations for a macro expansion in a vector, then iterate over them instead of using recursion. This simplifies the logic around the backtrace limit and gives easier access to the source locations. No functionality change. Patch by Zhengkai Wu. Differential Revision: http://reviews.llvm.org/D11542 llvm-svn: 243477
* Add -femulated-tls flag to select the emulated TLS model.Chih-Hung Hsieh2015-07-281-0/+3
| | | | | | | | | This will be used for old targets like Android that do not support ELF TLS models. Differential Revision: http://reviews.llvm.org/D10524 llvm-svn: 243441
* [Modules] Wrap the main ModuleManager visitor in a function_ref.Benjamin Kramer2015-07-251-29/+19
| | | | | | | Avoids the awkward passing of an opaque void *UserData argument. No functional change intended. llvm-svn: 243213
* [modules] Produce an error if -cc1 wants to implicitly build a module and noRichard Smith2015-07-211-8/+7
| | | | | | | module cache has been provided, rather than creating one in the current directory. llvm-svn: 242819
* Fix -save-temp when using objc-arc, sanitizer and profilingSteven Wu2015-07-171-1/+11
| | | | | | | | | | | | Currently, -save-temp will cause ObjCARC optimization to be dropped, sanitizer pass to run early in the pipeline, and profiling instrumentation to run twice. Fix the issue by properly disable all passes in the optimization pipeline when generating bitcode output and parse some of the Language Options even when the input is bitcode so the passes can be setup correctly. llvm-svn: 242565
* Make the clang module container format selectable from the command line.Adrian Prantl2015-07-179-37/+44
| | | | | | | | | | | | | - introduces a new cc1 option -fmodule-format=[raw,obj] with 'raw' being the default - supports arbitrary module container formats that libclang is agnostic to - adds the format to the module hash to avoid collisions - splits the old PCHContainerOperations into PCHContainerWriter and a PCHContainerReader. Thanks to Richard Smith for reviewing this patch! llvm-svn: 242499
* Extend -ftime-report to give more information about time spent reading ↵Richard Smith2015-07-141-2/+19
| | | | | | module files. llvm-svn: 242094
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-131-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | CUDA code. NOTE: reverts r242077 to reinstate r242058, r242065, 242067 and includes fix for OS X test failures. - Changed driver pipeline to compile host and device side of CUDA files and incorporate results of device-side compilation into host object file. - Added a test for cuda pipeline creation in clang driver. New clang options: --cuda-host-only - Do host-side compilation only. --cuda-device-only - Do device-side compilation only. --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more than once in which case one device-compilation will be done per unique specified GPU architecture. Differential Revision: http://reviews.llvm.org/D9509 llvm-svn: 242085
* [OpenMP] Add TLS-based implementation for threadprivate directive.Samuel Antao2015-07-131-0/+2
| | | | llvm-svn: 242080
* This reverts commit r242058, r242065, r242067.Rafael Espindola2015-07-131-15/+2
| | | | | | | | | | The tests were failing on OS X. Revert "[cuda] Driver changes to compile and stitch together host and device-side CUDA code." Revert "Fixed regex to properly match '64' in the test case." Revert "clang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least." llvm-svn: 242077
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-131-2/+15
| | | | | | | | | | | | | | | | | | | | | | | CUDA code. - Changed driver pipeline to compile host and device side of CUDA files and incorporate results of device-side compilation into host object file. - Added a test for cuda pipeline creation in clang driver. New clang options: --cuda-host-only - Do host-side compilation only. --cuda-device-only - Do device-side compilation only. --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more than once in which case one device-compilation will be done per unique specified GPU architecture. Differential Revision: http://reviews.llvm.org/D9509 llvm-svn: 242058
* Add an experimental flag -fsanitize-memory-use-after-dtor.Evgeniy Stepanov2015-07-101-0/+2
| | | | | | | | | | | This flag will enable detection of use-after-destructor (but before memory deallocation) bugs. No actual functionality yet. https://code.google.com/p/address-sanitizer/issues/detail?id=73 Patch by Naomi Musgrave. llvm-svn: 241935
* Revert r241770 and add Basic to the dependencies of clang-check instead.Adrian Prantl2015-07-091-3/+0
| | | | | | PR24067. llvm-svn: 241782
* Move the definition of ~PCHContainerOperations from Basic into Frontend.Adrian Prantl2015-07-091-0/+3
| | | | | | Fixes PR24067. llvm-svn: 241770
* Revert "Revert r241620 and follow-up commits" and move the initializationAdrian Prantl2015-07-081-2/+0
| | | | | | of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp. llvm-svn: 241653
* Revert r241620 and follow-up commits while investigating linux buildbot ↵Adrian Prantl2015-07-071-0/+2
| | | | | | failures. llvm-svn: 241642
* Wrap clang modules and pch files in an object file container.Adrian Prantl2015-07-071-2/+0
| | | | | | | | | | | | | This patch adds ObjectFilePCHContainerOperations uses the LLVM backend to put the contents of a PCH into a __clangast section inside a COFF, ELF, or Mach-O object file container. This is done to facilitate module debugging by makeing it possible to store the debug info for the types defined by a module alongside the AST. rdar://problem/20091852 llvm-svn: 241620
* [libclang] Replace ObjC generic parameters in code-completion results.Douglas Gregor2015-07-071-3/+4
| | | | | | rdar://19369529 llvm-svn: 241557
* Resubmit "Pass down the -flto option to the -cc1 job" (r239481)Teresa Johnson2015-07-061-0/+2
| | | | | | | | | | | | | | | | | | The patch is the same except for the addition of a new test for the issue that required reverting the dependent llvm commit. --Original Commit Message-- Pass down the -flto option to the -cc1 job, and from there into the CodeGenOptions and onto the PassManagerBuilder. This enables gating the new EliminateAvailableExternally module pass on whether we are preparing for LTO. If we are preparing for LTO (e.g. a -flto -c compile), the new pass is not included as we want to preserve available externally functions for possible link time inlining. llvm-svn: 241467
* Replace some const std::string & with llvm::StringRef or std::stringYaron Keren2015-07-061-3/+3
| | | | | | | | and std::move to avoid implicit std::string construction. Patch by Eugene Kosov. llvm-svn: 241433
* Revert r241330. It compiled with Visual C++ 2013 and gcc 4.9.1 (mingw) but ↵Yaron Keren2015-07-031-3/+3
| | | | | | now fails the bots. llvm-svn: 241335
* Replace some const std::string & with llvm::StringRef or std::stringYaron Keren2015-07-031-3/+3
| | | | | | | | and std::move to avoid implicit std::string construction. Patch by Eugene Kosov. llvm-svn: 241330
* Revert r241319, investigating.Yaron Keren2015-07-031-3/+3
| | | | llvm-svn: 241321
* Replace some const std::string & with llvm::StringRef or std::stringYaron Keren2015-07-031-3/+3
| | | | | | | | | | and std::move to avoid implicit std::string construction. Part 1/2. Patch by Eugene Kosov. llvm-svn: 241319
* Switch users of the 'for (StmtRange range = stmt->children(); range; ↵Benjamin Kramer2015-07-022-45/+37
| | | | | | | | | ++range)‘ pattern to range for loops. The pattern was born out of the lack of range-based for loops in C++98 and is somewhat obscure. No functionality change intended. llvm-svn: 241300
* Support mingw-w64 and mingw.org toolchains at any install location.Yaron Keren2015-07-021-60/+5
| | | | | | | | | | | | | No more hardcoded paths: clang will use -sysroot as gcc root location if provided. Otherwise, it will search for gcc on the path. If not found it will use the driver installed location. http://reviews.llvm.org/D5268 Patch by Ruben Van Boxem, Martell Malone, Yaron Keren. Reviewed by Reid Kleckner. llvm-svn: 241241
* Fix a couple of unused variables in no-assertsJustin Bogner2015-07-011-0/+2
| | | | llvm-svn: 241144
* -frewrite-includes: Prefer insert to emplaceJustin Bogner2015-07-011-3/+4
| | | | | | Some bots didn't like r241140. llvm-svn: 241141
* -frewrite-includes: Rework how includes and modules are differentiatedJustin Bogner2015-07-011-39/+50
| | | | | | | | | | | | | | | | | | | | The map of FileChange structs here was storing two disjoint types of information: 1. A pointer to the Module that an #include directive implicitly imported 2. A FileID and FileType for an included file. These would be left uninitialized in the Module case. This change splits these two kinds of information into their own maps, which both simplifies how we access either and avoids the undefined behaviour we were hitting due to the uninitialized fields in the included file case. Mostly NFC, but fixes some errors found by self-host with ubsan. llvm-svn: 241140
* [ObjC] Add NSValue support for objc_boxed_expressionsAlex Denisov2015-06-261-0/+9
| | | | | | | | | | | | | Patch extends ObjCBoxedExpr to accept records (structs and unions): typedef struct __attribute__((objc_boxable)) _Color { int r, g, b; } Color; Color color; NSValue *boxedColor = @(color); // [NSValue valueWithBytes:&color objCType:@encode(Color)]; llvm-svn: 240761
* Add __nonnull/__nullable/__null_unspecified predefines for Darwin.Douglas Gregor2015-06-241-0/+8
| | | | | | Addresses the rest of rdar://problem/21530726. llvm-svn: 240597
* [Modules] Consider -fmodule-feature in module hash and when loadingBen Langmuir2015-06-232-0/+11
| | | | | | | Any extra features from -fmodule-feature are part of the module hash and need to get validated on load. Also print them with -module-file-info. llvm-svn: 240433
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-2216-18/+18
| | | | llvm-svn: 240353
* Update for LLVM API change to return by InputArgList directly (rather than ↵David Blaikie2015-06-221-18/+18
| | | | | | by pointer) from ParseArgs llvm-svn: 240349
* [modules] Add a flag to disable the feature that permits conflicting ↵Richard Smith2015-06-221-0/+2
| | | | | | | | | | | | redefinitions of internal-linkage symbols that are not visible. Such conflicts are an accident waiting to happen, and this feature conflicts with the desire to include existing headers into multiple modules and merge the results. (In an ideal world, it should not be possible to export internal linkage symbols from a module, but sadly the glibc and libstdc++ headers provide 'static inline' functions in a few cases.) llvm-svn: 240335
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-2216-18/+18
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* ArrayRef-ify ParseArgsDavid Blaikie2015-06-211-2/+2
| | | | llvm-svn: 240237
* Introduce a PCHContainerOperations interface (NFC).Adrian Prantl2015-06-209-112/+242
| | | | | | | | | | | | | | | | A PCHContainerOperations abstract interface provides operations for creating and unwrapping containers for serialized ASTs (precompiled headers and clang modules). The default implementation is RawPCHContainerOperations, which uses a flat file for the output. The main application for this interface will be an ObjectFilePCHContainerOperations implementation that uses LLVM to wrap the module in an ELF/Mach-O/COFF container to store debug info alongside the AST. rdar://problem/20091852 llvm-svn: 240225
* Introduce -fsanitize-trap= flag.Peter Collingbourne2015-06-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | This flag controls whether a given sanitizer traps upon detecting an error. It currently only supports UBSan. The existing flag -fsanitize-undefined-trap-on-error has been made an alias of -fsanitize-trap=undefined. This change also cleans up some awkward behavior around the combination of -fsanitize-trap=undefined and -fsanitize=undefined. Previously we would reject command lines containing the combination of these two flags, as -fsanitize=vptr is not compatible with trapping. This required the creation of -fsanitize=undefined-trap, which excluded -fsanitize=vptr (and -fsanitize=function, but this seems like an oversight). Now, -fsanitize=undefined is an alias for -fsanitize=undefined-trap, and if -fsanitize-trap=undefined is specified, we treat -fsanitize=vptr as an "unsupported" flag, which means that we error out if the flag is specified explicitly, but implicitly disable it if the flag was implied by -fsanitize=undefined. Differential Revision: http://reviews.llvm.org/D10464 llvm-svn: 240105
* Add missing overrides to MultiplexConsumer. Test coverage will beAdrian Prantl2015-06-181-0/+26
| | | | | | provided by an upcoming commit. llvm-svn: 240026
* [fixit] Use overwriteChangedFiles() to deal with Windows mapped filesReid Kleckner2015-06-172-2/+10
| | | | | | Fixes one instance of PR17960. llvm-svn: 239920
* [modules] Simplify -cc1 interface for enabling implicit module maps.Richard Smith2015-06-161-4/+1
| | | | | | | | | | | | | We used to have a flag to enable module maps, and two more flags to enable implicit module maps. This is all redundant; we don't need any flag for enabling module maps in the abstract, and we don't usually have -fno- flags for -cc1. We now have just a single flag, -fimplicit-module-maps, that enables implicitly searching the file system for module map files and loading them. The driver interface is unchanged for now. We should probably rename -fmodule-maps to -fimplicit-module-maps at some point. llvm-svn: 239789
* According to the OpenMP spec, all the preprocessor macros should be Samuel Antao2015-06-151-10/+42
| | | | | | expanded in OpenMP pragmas. This patch adds support for that in -E. llvm-svn: 239784
* Add `-verify-ignore-unexpected` option to ignore unexpected diagnostics in ↵Eric Fiselier2015-06-132-13/+60
| | | | | | | | | | | | | | | | | | | | | VerifyDiagnosticsConsumer Summary: The goal of this patch is to make `-verify` easier to use when testing libc++. The `notes` attached to compile error diagnostics are numerous and relatively unstable when they reference libc++ header internals. This patch allows libc++ to write stable compilation failure tests by allowing unexpected diagnostic messages to be ignored where they are not relevant. This patch adds a new CC1 flag called `-verify-ignore-unexpected`. `-verify-ignore-unexpected` tells `VerifyDiagnosticsConsumer` to ignore *all* unexpected diagnostic messages. `-verify-ignore-unexpected=<LevelList>` can be used to only ignore certain diagnostic levels. `<LevelList>` is a comma separated list of diagnostic levels to ignore. The supported levels are `note`, `remark`, `warning` and `error`. Reviewers: bogner, grosser, EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10138 llvm-svn: 239665
* Revert commit r239481 as it is dependent on reverted llvm commit r239480.Teresa Johnson2015-06-121-2/+0
| | | | llvm-svn: 239588
OpenPOWER on IntegriCloud