summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* This reverts r305820 (ARMv.2-A FP16 vector intrinsics) because it showsSjoerd Meijer2017-07-061-1/+0
| | | | | | | | | problems in testing, see comments in D34161 for some more details. A fix is in progres in D35011, but a revert seems better now as the fix will probably take some more time to land. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307277 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] ADD ARMv.2-A FP16 vector intrinsicsAbderrazek Zaafrani2017-06-201-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D34161 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305820 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Fix OpenCL and SPIR version metadata generation.Alexey Bader2017-06-201-0/+34
| | | | | | | | | | | | | | Summary: OpenCL and SPIR version metadata must be generated once per module instead of once per mangled global value. Reviewers: Anastasia, yaxunl Reviewed By: Anastasia Subscribers: ahatanak, cfe-commits Differential Revision: https://reviews.llvm.org/D34235 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305796 91177308-0d34-0410-b5e6-96231b3b80d8
* IR: Replace the "Linker Options" module flag with "llvm.linker.options" ↵Peter Collingbourne2017-06-121-5/+5
| | | | | | | | | | named metadata. The new metadata is easier to manipulate than module flags. Differential Revision: https://reviews.llvm.org/D31349 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305227 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for #pragma clang sectionJaved Absar2017-06-051-1/+29
| | | | | | | | | | | | | | | | | This patch provides a means to specify section-names for global variables, functions and static variables, using #pragma directives. This feature is only defined to work sensibly for ELF targets. One can specify section names as: #pragma clang section bss="myBSS" data="myData" rodata="myRodata" text="myText" One can "unspecify" a section name with empty string e.g. #pragma clang section bss="" data="" text="" rodata="" Reviewers: Roger Ferrer, Jonathan Roelofs, Reid Kleckner Differential Revision: https://reviews.llvm.org/D33412 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304705 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-031-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304649 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[AArch64] Add ARMv8.2-A FP16 vefctor intrinsics"Vedant Kumar2017-06-021-1/+0
| | | | | | | | | | | | This reverts commit r304493. It breaks all the Darwin bots: http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental_check/37168 Failure: Failing Tests (2): Clang :: CodeGen/aarch64-v8.2a-neon-intrinsics.c Clang :: CodeGen/arm_neon_intrinsics.c git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304509 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Add ARMv8.2-A FP16 vefctor intrinsicsAbderrazek Zaafrani2017-06-011-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304493 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed warningsPiotr Padlewski2017-06-011-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304397 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit available_externally vtables opportunisticallyPiotr Padlewski2017-06-011-0/+23
| | | | | | | | | | | | | | Summary: We can emit vtable definition having inline function if they are all emitted. Reviewers: rjmccall, rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33437 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304394 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen] Surround assertion with parens and format.Davide Italiano2017-05-311-4/+4
| | | | | | This should placate GCC7 with -Werror. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304322 91177308-0d34-0410-b5e6-96231b3b80d8
* IRGen: Add optnone attribute on function during O0Mehdi Amini2017-05-291-2/+12
| | | | | | | | | | | Amongst other, this will help LTO to correctly handle/honor files compiled with O0, helping debugging failures. It also seems in line with how we handle other options, like how -fnoinline adds the appropriate attribute as well. Differential Revision: https://reviews.llvm.org/D28404 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304127 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenMP] Create COMDAT group for OpenMP offload registration code to avoid ↵George Rokos2017-05-271-2/+5
| | | | | | | | | | | multiple copies Thanks to Sergey Dmitriev for submitting the patch. Differential Revision: https://reviews.llvm.org/D33509 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304056 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay][clang] Allow imbuing arg1 logging attribute via -fxray-always-instrument=Dean Michael Berris2017-05-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: This change allows us to add arg1 logging support to functions through the special case list provided through -fxray-always-instrument=. This is useful for adding arg1 logging to functions that are either in headers that users don't have control over (i.e. cannot change the source) or would rather not do. It only takes effect when the pattern is matched through the "fun:" special case, as a category. As in: fun:*pattern=arg1 Reviewers: pelikan, rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33392 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303719 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGenModule: Always output wchar_size, check LLVM assumptions.Matthias Braun2017-05-201-6/+13
| | | | | | | | | | | | | | Re-commit r303463 now that LLVM is fixed and adjust some lit tests. llvm::TargetLibraryInfo needs to know the size of wchar_t to work on functions like `wcslen`. This patch changes clang to always emit the wchar_size module flag (it would only do so for ARM previously). This also adds an `assert()` to ensure the LLVM defaults based on the target triple are in sync with clang. Differential Revision: https://reviews.llvm.org/D32982 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303478 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "CodeGenModule: Always output wchar_size, check LLVM assumptions."Matthias Braun2017-05-201-13/+6
| | | | | | | | | Let's revert this for now (and with it the assert()) to get the bots back to green until I have LLVM synced up properly. This reverts commit r303463. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303474 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGenModule: Always output wchar_size, check LLVM assumptions.Matthias Braun2017-05-191-6/+13
| | | | | | | | | | | | llvm::TargetLibraryInfo needs to know the size of wchar_t to work on functions like `wcslen`. This patch changes clang to always emit the wchar_size module flag (it would only do so for ARM previously). This also adds an `assert()` to ensure the LLVM defaults based on the target triple are in sync with clang. Differential Revision: https://reviews.llvm.org/D32982 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303463 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen: Cast alloca to expected address spaceYaxun Liu2017-05-181-0/+1
| | | | | | | | | | | | Alloca always returns a pointer in alloca address space, which may be different from the type defined by the language. For example, in C++ the auto variables are in the default address space. Therefore cast alloca to the expected address space when necessary. Differential Revision: https://reviews.llvm.org/D32248 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303370 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress all uses of LLVM_END_WITH_NULL. NFC.Serge Guelton2017-05-091-1/+1
| | | | | | | | | | | Use variadic templates instead of relying on <cstdarg> + sentinel. This enforces better type checking and makes code more readable. Differential revision: https://reviews.llvm.org/D32550 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302572 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-land r301697 "[IR] Make add/remove Attributes use AttrBuilder instead of ↵Reid Kleckner2017-05-021-10/+3
| | | | | | | | | | AttributeList" This time, I fixed, built, and tested clang. This reverts r301712. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301981 91177308-0d34-0410-b5e6-96231b3b80d8
* Adapt to LLVM's rename of WeakVH to WeakTrackingVH; NFCSanjoy Das2017-05-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301815 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded struct; NFCSanjoy Das2017-05-011-12/+9
| | | | | | | | | | | | | | Summary: Unless I'm missing something, the DeferredGlobal struct's GV field is unused, removing which makes the struct itself trivial. Reviewers: rafael, chandlerc Subscribers: mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D32691 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301789 91177308-0d34-0410-b5e6-96231b3b80d8
* [Profile] Add off-by-default -Wprofile-instr-missing warningVedant Kumar2017-04-271-3/+7
| | | | | | | | | | | | | | | Clang warns that a profile is out-of-date if it can't find a profile record for any function in a TU. This warning became noisy after llvm started allowing dead-stripping of instrumented functions. To fix this, this patch changes the existing profile out-of-date warning (-Wprofile-instr-out-of-date) so that it only complains about mismatched data. Further, it introduces a new, off-by-default warning about missing function data (-Wprofile-instr-missing). Differential Revision: https://reviews.llvm.org/D28867 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301570 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Update to LLVM's use of WeakTrackingVH; NFC"Sanjoy Das2017-04-261-1/+1
| | | | | | This reverts commit r301427. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301430 91177308-0d34-0410-b5e6-96231b3b80d8
* Update to LLVM's use of WeakTrackingVH; NFCSanjoy Das2017-04-261-1/+1
| | | | | | | | | | | | Summary: Depends on D32266 Reviewers: davide, dblaikie Subscribers: mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D32270 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301427 91177308-0d34-0410-b5e6-96231b3b80d8
* [Devirtualization] Emit invariant.group loads with empty group mdPiotr Padlewski2017-04-241-6/+2
| | | | | | | | | | | | | | | Summary: As discussed here http://lists.llvm.org/pipermail/llvm-dev/2017-January/109332.html having different groups doesn't solve the problem entirly. Reviewers: rjmccall, rsmith Subscribers: amharc, cfe-commits Differential Revision: https://reviews.llvm.org/D32110 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301178 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix assertion failure in codegen on non-template deduction guide.Richard Smith2017-04-191-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300762 91177308-0d34-0410-b5e6-96231b3b80d8
* Use less temporary AttributeLists NFCReid Kleckner2017-04-181-4/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300628 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen: Let lifetime intrinsic use alloca address spaceYaxun Liu2017-04-171-0/+2
| | | | | | | Differential Revision: https://reviews.llvm.org/D31717 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300485 91177308-0d34-0410-b5e6-96231b3b80d8
* [IR] Make getParamAttributes take argument numbers, not ArgNo+1Reid Kleckner2017-04-131-1/+1
| | | | | | | | | | | | Add hasParamAttribute() and use it instead of hasAttribute(ArgNo+1, Kind) everywhere. The fact that the AttributeList index for an argument is ArgNo+1 should be a hidden implementation detail. NFC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300272 91177308-0d34-0410-b5e6-96231b3b80d8
* [IR] Take func, ret, and arg attrs separately in AttributeList::getReid Kleckner2017-04-131-12/+8
| | | | | | | | | | | | | This seems like a much more natural API, based on Derek Schuff's comments on r300015. It further hides the implementation detail of AttributeList that function attributes come last and appear at index ~0U, which is easy for the user to screw up. git diff says it saves code as well: 97 insertions(+), 137 deletions(-) This also makes it easier to change the implementation, which I want to do next. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300153 91177308-0d34-0410-b5e6-96231b3b80d8
* [IR] Add AttributeSet to hide AttributeSetNode* again, NFCReid Kleckner2017-04-121-1/+1
| | | | | | | | | | | | | | | | | Summary: For now, it just wraps AttributeSetNode*. Eventually, it will hold AvailableAttrs as an inline bitset, and adding and removing enum attributes will be super cheap. This sinks AttributeSetNode back down to lib/IR/AttributeImpl.h. Reviewers: pete, chandlerc Subscribers: llvm-commits, jfb Differential Revision: https://reviews.llvm.org/D31940 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300014 91177308-0d34-0410-b5e6-96231b3b80d8
* Modular Codegen: Support homing debug info for types in modular objectsDavid Blaikie2017-04-111-0/+5
| | | | | | | | | Matching the function-homing support for modular codegen. Any type implicitly (implicit template specializations) or explicitly defined in a module is attached to that module's object file and omitted elsewhere (only a declaration used if necessary for references). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299987 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland "[IR] Make AttributeSetNode public, avoid temporary AttributeList copies"Reid Kleckner2017-04-101-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | This re-lands r299875. I introduced a bug in Clang code responsible for replacing K&R, no prototype declarations with a real function definition with a prototype. The bug was here: // Collect any return attributes from the call. - if (oldAttrs.hasAttributes(llvm::AttributeList::ReturnIndex)) - newAttrs.push_back(llvm::AttributeList::get(newFn->getContext(), - oldAttrs.getRetAttributes())); + newAttrs.push_back(oldAttrs.getRetAttributes()); Previously getRetAttributes() carried AttributeList::ReturnIndex in its AttributeList. Now that we return the AttributeSetNode* directly, it no longer carries that index, and we call this overload with a single node: AttributeList::get(LLVMContext&, ArrayRef<AttributeSetNode*>) That aborted with an assertion on x86_32 targets. I added an explicit triple to the test and added CHECKs to help find issues like this in the future sooner. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299899 91177308-0d34-0410-b5e6-96231b3b80d8
* [cfi] Emit __cfi_check stub in the frontend.Evgeniy Stepanov2017-04-071-1/+3
| | | | | | | | | Previously __cfi_check was created in LTO optimization pipeline, which means LLD has no way of knowing about the existence of this symbol without rescanning the LTO output object. As a result, LLD fails to export __cfi_check, even when given --export-dynamic-symbol flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299806 91177308-0d34-0410-b5e6-96231b3b80d8
* Move NumRegParameters Module Flag. NFCI.Nirav Dave2017-03-301-6/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299079 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay] Add -fxray-{always,never}-instrument= flags to clangDean Michael Berris2017-03-301-0/+24
| | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299041 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen] Emit a CoreFoundation link guard when @available is usedAlex Lorenz2017-03-231-0/+1
| | | | | | | | | | | | | | | | | After r297760, __isOSVersionAtLeast in compiler-rt loads the CoreFoundation symbols at runtime. This means that `@available` will always fail when used in a binary without a linked CoreFoundation. This commit forces Clang to emit a reference to a CoreFoundation symbol when `@available` is used to ensure that linking will fail when CoreFoundation isn't linked with the build product. rdar://31039592 Differential Revision: https://reviews.llvm.org/D30977 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298588 91177308-0d34-0410-b5e6-96231b3b80d8
* Update Clang for LLVM rename AttributeSet -> AttributeListReid Kleckner2017-03-211-42/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298394 91177308-0d34-0410-b5e6-96231b3b80d8
* IRGen: Do not set dllexport on declarations.Peter Collingbourne2017-03-211-1/+0
| | | | | | | | | | | Setting dllexport on a declaration has no effect, as we do not emit export directives for declarations. Part of the fix for PR32334. Differential Revision: https://reviews.llvm.org/D31162 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298330 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Add NumRegisterParameters Module Flag.Nirav Dave2017-03-181-0/+7
| | | | | | | | | | Reviewers: rnk, mkuper Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27051 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298177 91177308-0d34-0410-b5e6-96231b3b80d8
* Promote ConstantInitBuilder to be a public CodeGen API; it'sJohn McCall2017-03-021-1/+1
| | | | | | a generally useful utility for other frontends. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296806 91177308-0d34-0410-b5e6-96231b3b80d8
* [dllimport] Check for dtor references in functionsHans Wennborg2017-02-151-13/+31
| | | | | | | | | | | Destructor references are not modelled explicitly in the AST. This adds checks for destructor calls due to variable definitions and temporaries. If a dllimport function references a non-dllimport destructor, it must not be emitted available_externally, as the referenced destructor might live across the DLL boundary and isn't exported. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295258 91177308-0d34-0410-b5e6-96231b3b80d8
* [dllimport] Look through typedefs and arrays in HasNonDllImportDtorHans Wennborg2017-02-151-1/+1
| | | | | | | | The function is used to check whether a type is a class with non-dllimport destructor. It needs to look through typedefs and array types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295257 91177308-0d34-0410-b5e6-96231b3b80d8
* Prototype of modules codegenDavid Blaikie2017-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | First pass at generating weak definitions of inline functions from module files (& skipping (-O0) or emitting available_externally (optimizations) definitions where those modules are used). External functions defined in modules are emitted into the modular object file as well (this may turn an existing ODR violation (if that module were imported into multiple translations) into valid/linkable code). Internal symbols (static functions, for example) are not correctly supported yet. The symbol will be produced, internal, in the modular object - unreferenceable from the users. Reviewers: rsmith Differential Revision: https://reviews.llvm.org/D28845 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293456 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-commit "Don't inline dllimport functions referencing non-imported methods"Hans Wennborg2017-01-231-0/+10
| | | | | | | This re-commits r292522 with the addition that it also handles calls through pointer to member functions without crashing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292856 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Don't inline dllimport functions referencing non-imported methods"Reid Kleckner2017-01-201-5/+0
| | | | | | | This reverts commit r292522. It appears to be causing crashes in builds using dllimport. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292643 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't inline dllimport functions referencing non-imported methodsHans Wennborg2017-01-191-0/+5
| | | | | | | This is another follow-up to r246338. I had assumed methods were already handled by the AST visitor, but turns out they weren't. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292522 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove now redundant code that ensured debug info for class definitions was ↵David Blaikie2017-01-181-17/+0
| | | | | | | | | | | emitted under certain circumstances Introduced in r181561 - it may've been subsumed by work done to allow emission of declarations for vtable types while still emitting some of their member functions correctly for those declarations. Whatever the reason, the tests pass without this code now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292439 91177308-0d34-0410-b5e6-96231b3b80d8
* [WebAssembly] Add minimal support for the new wasm object format triple.Dan Gohman2017-01-171-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292269 91177308-0d34-0410-b5e6-96231b3b80d8