summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* PR21217: Slightly more eagerly load -fmodule-map-file= files and provideRichard Smith2014-12-062-3/+9
| | | | | | diagnostics if they don't exist. Based on a patch by John Thompson! llvm-svn: 223561
* Use isOSBinFormatMachO() instead of comparing the object formatEric Christopher2014-12-051-1/+1
| | | | | | against an enum. llvm-svn: 223422
* CUDA host device code with two code pathsReid Kleckner2014-12-032-0/+10
| | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 223271
* [modules] Track how 'header' directives were written in module map files,Richard Smith2014-12-022-30/+52
| | | | | | | | | | | | | rather than trying to extract this information from the FileEntry after the fact. This has a number of beneficial effects. For instance, diagnostic messages for failed module builds give a path relative to the "module root" rather than an absolute file path, and the contents of the module includes file is no longer dependent on what files the including TU happened to inspect prior to triggering the module build. llvm-svn: 223095
* 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. llvm-svn: 222745
* 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 llvm-svn: 222444
* Update for LLVM API change to make Small(Ptr)Set::insert return ↵David Blaikie2014-11-193-7/+7
| | | | | | pair<iterator, bool> as per the C++ standard's associative container concept. llvm-svn: 222335
* Standardize on StringMap::insert, removing uses of StringMap::GetOrCreateValue.David Blaikie2014-11-191-5/+5
| | | | llvm-svn: 222306
* Update for LLVM API changeDavid Blaikie2014-11-191-2/+2
| | | | llvm-svn: 222303
* Make DiagnosticsEngine::takeClient return std::unique_ptr<>Alexander Kornienko2014-11-174-30/+21
| | | | | | | | | | | | | | | | | | Summary: Make DiagnosticsEngine::takeClient return std::unique_ptr<>. Updated callers to store conditional ownership using a pair of pointer and unique_ptr instead of a pointer + bool. Updated code that temporarily registers clients to use the non-owning registration (+ removed extra calls to takeClient). Reviewers: dblaikie Reviewed By: dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6294 llvm-svn: 222193
* A small correction for r221884. No functional changes.Alexander Kornienko2014-11-171-1/+1
| | | | llvm-svn: 222130
* Add DiagID and Warning Flag to DiagnosticsLogSteven Wu2014-11-141-0/+10
| | | | llvm-svn: 222042
* Remove some redundant virtual specifiers on overriden functions.David Blaikie2014-11-141-2/+2
| | | | llvm-svn: 222024
* Remove -fseh-exceptions in favor of checking the tripleReid Kleckner2014-11-142-3/+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. llvm-svn: 221963
* Support non-owned DiagnosticConsumer in SetupSerializedDiagnosticsAlexander Kornienko2014-11-131-4/+8
| | | | | | | | | | This fixes an assertion when running clang-tidy on a file having --serialize-diagnostics in compiler options. Committing a regression test for clang-tidy separately. Patch by Aaron Wishnick! llvm-svn: 221884
* Update Clang's SD-6 support to match N4200 (except for __has_cpp_attribute,Richard Smith2014-11-121-0/+16
| | | | | | which we don't yet implement). llvm-svn: 221816
* Simplify code a bit by passing StreamFile to the BitstreamCursor constructor.Rafael Espindola2014-11-121-2/+1
| | | | llvm-svn: 221784
* 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 llvm-svn: 221719
* [OPENMP] Codegen for threadprivate variablesAlexey Bataev2014-11-111-0/+6
| | | | | | | | | For all threadprivate variables which have constructor/destructor emit call to void __kmpc_threadprivate_register(ident_t * <Current Location>, void *<Original Global Addr>, kmpc_ctor <Constructor>, kmpc_cctor NULL, kmpc_dtor <Destructor>); In expressions all references to such variables are replaced by calls to void *__kmpc_threadprivate_cached(ident_t *<Current Location>, kmp_int32 <Current Thread Id>, void *<Original Global Addr>, size_t <Size of Data>, void ***<Pointer to autogenerated cache – array of private copies of threadprivate variable>); Test test/OpenMP/threadprivate_codegen.cpp checks that codegen is correct. Also it checks that codegen is correct after serialization/deserialization and one of passes verifies debug info. Differential Revision: http://reviews.llvm.org/D4002 llvm-svn: 221663
* [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. llvm-svn: 221653
* Move CodeGenOptions constructor out-of-line and add missing headers. NFC.Alexey Samsonov2014-11-112-0/+25
| | | | llvm-svn: 221646
* 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. llvm-svn: 221558
* 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 llvm-svn: 221001
* [libclang] Disable spell-checking and warnings during code-completion since ↵Argyrios Kyrtzidis2014-10-311-0/+4
| | | | | | they are not needed. llvm-svn: 220966
* [modules] When a .pcm file is explicitly built separately from the translationRichard Smith2014-10-312-4/+4
| | | | | | unit, allow the -O settings of the two compilations to differ. llvm-svn: 220943
* Objective-C modern rewriter. Patch to fix a rewriting bug Fariborz Jahanian2014-10-281-0/+4
| | | | | | | rewriting an Objective-C block. Patch by Ryan Govostes. rdar://18799145 llvm-svn: 220834
* [modules] Load .pcm files specified by -fmodule-file lazily.Richard Smith2014-10-272-53/+70
| | | | llvm-svn: 220731
* Frontend: Don't include stdin in the dependency list for an object fileDavid Majnemer2014-10-271-2/+11
| | | | | | | | | GCC doesn't do this and it semes weird to include a file that we can't open. This fixes PR21362. llvm-svn: 220726
* Frontend: Define __EXCEPTIONS if -fexceptions is passedDavid Majnemer2014-10-271-1/+1
| | | | | | | | | GCC defines __EXCEPTIONS, regardless of language mode, if -fexceptions is passed. We should do the same. This fixes PR21358. llvm-svn: 220714
* Make VFS and FileManager match the current MemoryBuffer API.Benjamin Kramer2014-10-264-14/+19
| | | | | | | This eliminates converting back and forth between the 3 formats and gives us a more homogeneous interface. llvm-svn: 220657
* Add a new -fmerge-functions -cc1 flag that enables function merging.Nick Lewycky2014-10-241-0/+1
| | | | llvm-svn: 220543
* Driver: Include driver diagnostics when we --serialize-diagnosticsJustin Bogner2014-10-233-27/+232
| | | | | | | | | | | | | | | 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 llvm-svn: 220525
* Remove code duplication and cut dependency from clangRewrite onDaniel Jasper2014-10-232-34/+12
| | | | | | clangAST. llvm-svn: 220502
* 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 llvm-svn: 220383
* [modules] Initial support for explicitly loading .pcm files.Richard Smith2014-10-224-6/+67
| | | | | | | | | | | | | | | 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. llvm-svn: 220359
* Follow-up commit to r211657 which introduced these macros, but not for MSVC. ↵Aaron Ballman2014-10-211-54/+48
| | | | | | This turns out to break our freestanding tests on Windows when compiling in MSVC-compatible mode. It was decided (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20141020/116942.html is the start of the thread) to support this as part of Clang's interface on all platforms. llvm-svn: 220312
* 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. llvm-svn: 220244
* [modules] Add support for #include_next.Richard Smith2014-10-201-2/+3
| | | | | | | | | | | | #include_next interacts poorly with modules: it depends on where in the list of include paths the current file was found. Files covered by module maps are not found in include search paths when building the module (and are not found in include search paths when @importing the module either), so this isn't really meaningful. Instead, we fake up the result that #include_next *should* have given: find the first path that would have resulted in the given file being picked, and search from there onwards. llvm-svn: 220177
* Frontend: Fix some underscore-then-capital UBJustin Bogner2014-10-161-2/+2
| | | | llvm-svn: 219903
* 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). llvm-svn: 219842
* Frontend: Don't accept null DiagnosticsEngines when building ASTUnitsJustin Bogner2014-10-151-17/+4
| | | | | | | | | | | | | The various ways to create an ASTUnit all take a refcounted pointer to a diagnostics engine as an argument, and if it isn't pointing at anything they initialize it. This is a pretty confusing API, and it really makes more sense for the caller to initialize the thing since they control the lifetime anyway. This fixes the one caller that didn't bother initializing the pointer and asserts that the argument is initialized. llvm-svn: 219752
* Frontend: Remove some unused arguments in ASTUnit (NFC)Justin Bogner2014-10-141-5/+4
| | | | llvm-svn: 219747
* Re-apply "Frontend: Extract SerializedDiagnosticReader out of ↵Justin Bogner2014-10-143-4/+300
| | | | | | | | | | | | CXLoadedDiagnostic (NFC)" I'd mispelled "Bitcode/BitCodes.h" before, and tested on a case insensitive filesystem. This reverts commit r219649, effectively re-applying r219647 and r219648. llvm-svn: 219664
* Extend -Rmodule-build to also remark when module building finishes.Richard Smith2014-10-141-4/+9
| | | | | | | In cases of nested module builds, or when you care how long module builds take, this information was not previously easily available / obvious. llvm-svn: 219658
* Revert "Frontend: Extract SerializedDiagnosticReader out of ↵Justin Bogner2014-10-143-300/+4
| | | | | | | | | | | CXLoadedDiagnostic (NFC)" The bots can't seem to find an include file. Reverting for now and I'll look into it in a bit. This reverts commits r219647 and r219648. llvm-svn: 219649
* Frontend: Try to fix cmake builders after r219647Justin Bogner2014-10-141-0/+1
| | | | | | Looks like I missed a dependency here. llvm-svn: 219648
* Frontend: Extract SerializedDiagnosticReader out of CXLoadedDiagnostic (NFC)Justin Bogner2014-10-143-4/+299
| | | | | | | | | We currently read serialized diagnostics directly in the C API, which makes it difficult to reuse this logic elsewhere. This extracts the core of the serialized diagnostic parsing logic into a base class that can be subclassed using a visitor pattern. llvm-svn: 219647
* Reduce double set lookups. NFC.Benjamin Kramer2014-10-101-4/+2
| | | | llvm-svn: 219504
* 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 llvm-svn: 219417
* 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 llvm-svn: 219027
OpenPOWER on IntegriCloud