summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Using MD_invariant_groupPiotr Padlewski2015-09-171-1/+1
| | | | | | http://reviews.llvm.org/D12927 llvm-svn: 247933
* Use the MSVC SEH personalities on MingwReid Kleckner2015-09-171-2/+4
| | | | | | | | Mingw generally wraps an old copy of msvcrt.dll which has these personalities, so things should work out, or so I hear. I haven't tested it. llvm-svn: 247902
* [WinEH] Fix a build issue in CGException.cppReid Kleckner2015-09-161-2/+1
| | | | | | I was constructing an object without filling in all the fields. llvm-svn: 247851
* [WinEH] Pass the catch adjectives to catchpad directlyReid Kleckner2015-09-168-58/+60
| | | | | | | | | This avoids building a fake LLVM IR global variable just to ferry an i32 down into LLVM codegen. It also puts a nail in the coffin of using MS ABI C++ EH with landingpads, since now we'll assert in the lpad code when flags are present. llvm-svn: 247843
* CGClass.cpp: Fix a warning in -Asserts. [-Wunused-private-field]NAKAMURA Takumi2015-09-161-0/+1
| | | | llvm-svn: 247778
* Implementation and testing for poisoning vtableNaomi Musgrave2015-09-161-17/+55
| | | | | | | | | | | | | | | | | | | | | | ptr in dtor. Summary: After destruction, invocation of virtual functions prevented by poisoning vtable pointer. Reviewers: eugenis, kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12712 Fixed testing callback emission order to account for vptr. Poison vtable in either complete or base dtor, depending on if virtual bases exist. If virtual bases exist, poison in complete dtor. Otherwise, poison in base. Remove commented-out block. llvm-svn: 247762
* Decorating vptr load & stores with !invariant.groupPiotr Padlewski2015-09-159-28/+69
| | | | | | | | | | Adding !invariant.group to vptr load/stores for devirtualization purposes. For more goto: http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html http://reviews.llvm.org/D12026 llvm-svn: 247725
* Added llvm.module flag for strict vtable pointersPiotr Padlewski2015-09-151-0/+16
| | | | | | | | | | | | It is dangerous to do LTO on code with strict-vtable-pointers, because one module has invariant.group.barriers, and the other one not. In the future I want to just strip all invariant.group metadata from vptrs loads/stores and get rid of invariant.group.barrier calls. http://reviews.llvm.org/D12580 llvm-svn: 247724
* Emiting llvm.invariant.group.barrier when dynamic type changesPiotr Padlewski2015-09-152-3/+38
| | | | | | | | | For more goto: http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html http://reviews.llvm.org/D12312 llvm-svn: 247723
* [OPENMP] Emit __kmpc_cancel_barrier() and code for 'cancellation point' only ↵Alexey Bataev2015-09-153-77/+123
| | | | | | | | | | | | | | if 'cancel' is found. Patch improves codegen for OpenMP constructs. If the OpenMP region does not have internal 'cancel' construct, a call to 'void __kmpc_barrier()' runtime function is generated for all implicit/explicit barriers. If the region has inner 'cancel' directive, then ``` if (__kmpc_cancel_barrier()) exit from outer construct; ``` code is generated. Also, the code for 'canellation point' directive is not generated if parent directive does not have 'cancel' directive. llvm-svn: 247681
* [OpenCL] Add new types for OpenCL 2.0.Alexey Bader2015-09-155-0/+90
| | | | | | | | Patch by Pedro Ferreira. Reviewers: pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D12855 llvm-svn: 247676
* ItaniumCXXABI.cpp: Fix a warning. [-Wunused-variable]NAKAMURA Takumi2015-09-151-2/+1
| | | | llvm-svn: 247655
* Generating assumption loads of vptr after ctor call (fixed)Piotr Padlewski2015-09-157-126/+258
| | | | | | | | | | | | | | | | | | Generating call assume(icmp %vtable, %global_vtable) after constructor call for devirtualization purposes. For more info go to: http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html Edit: Fixed version because of PR24479 and other bug caused in chrome. After this patch got reverted because of ScalarEvolution bug (D12719) Merged after John McCall big patch (Added Address). http://reviews.llvm.org/D11859 http://reviews.llvm.org/D12865 llvm-svn: 247646
* [WebAssembly] Simplify code by avoiding duplicating the default behavior.Dan Gohman2015-09-141-1/+0
| | | | llvm-svn: 247623
* Revert "Always_inline codegen rewrite" and 2 follow-ups.Evgeniy Stepanov2015-09-146-127/+11
| | | | | | | | | | Revert "Update cxx-irgen.cpp test to allow signext in alwaysinline functions." Revert "[CodeGen] Remove wrapper-free always_inline functions from COMDATs" Revert "Always_inline codegen rewrite." Reason for revert: PR24793. llvm-svn: 247620
* Fix a nasty bug with the partial destruction of nested arrays;John McCall2015-09-141-2/+2
| | | | | | | | | it escaped notice because it's only used for heterogeneous initialization. rdar://21397946 llvm-svn: 247597
* [opaque pointer type] Fix a few uses of PointerType::getElementType in favor ↵David Blaikie2015-09-144-12/+10
| | | | | | | | | | of uses of types already available elsewhere These are a few cleanups I happened to have from trying to go in a different direction recently, so just flushing them out while I have them. llvm-svn: 247593
* Revert "[opaque pointer type] update for LLVM API change"David Blaikie2015-09-145-10/+11
| | | | | | | | | | This was the wrong direction to take anyway (because ultimately the GlobalValue needed the pointee type again and /it/ used PointerType::getElementType eventually anyway)... let's go a different way. This reverts commit r236161. llvm-svn: 247586
* [CodeGen] Remove wrapper-free always_inline functions from COMDATsDavid Majnemer2015-09-121-1/+5
| | | | | | always_inline functions without a wrapper don't need to be in a COMDAT. llvm-svn: 247500
* Always_inline codegen rewrite.Evgeniy Stepanov2015-09-126-11/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current implementation may end up emitting an undefined reference for an "inline __attribute__((always_inline))" function by generating an "available_externally alwaysinline" IR function for it and then failing to inline all the calls. This happens when a call to such function is in dead code. As the inliner is an SCC pass, it does not process dead code. Libc++ relies on the compiler never emitting such undefined reference. With this patch, we emit a pair of 1. internal alwaysinline definition (called F.alwaysinline) 2a. A stub F() { musttail call F.alwaysinline } -- or, depending on the linkage -- 2b. A declaration of F. The frontend ensures that F.inlinefunction is only used for direct calls, and the stub is used for everything else (taking the address of the function, really). Declaration (2b) is emitted in the case when "inline" is meant for inlining only (like __gnu_inline__ and some other cases). This approach, among other nice properties, ensures that alwaysinline functions are always internal, making it impossible for a direct call to such function to produce an undefined symbol reference. This patch is based on ideas by Chandler Carruth and Richard Smith. llvm-svn: 247494
* Revert "Specify target triple in alwaysinline tests."Evgeniy Stepanov2015-09-116-117/+11
| | | | | | | | | Revert "Always_inline codegen rewrite." Breaks gdb & lldb tests. Breaks on Fedora 22 x86_64. llvm-svn: 247491
* When comparing two block captures for layout, don't crashJohn McCall2015-09-111-1/+1
| | | | | | | | if they have the same alignment and one was 'this'. Fixes PR24780. llvm-svn: 247482
* Always_inline codegen rewrite.Evgeniy Stepanov2015-09-116-11/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current implementation may end up emitting an undefined reference for an "inline __attribute__((always_inline))" function by generating an "available_externally alwaysinline" IR function for it and then failing to inline all the calls. This happens when a call to such function is in dead code. As the inliner is an SCC pass, it does not process dead code. Libc++ relies on the compiler never emitting such undefined reference. With this patch, we emit a pair of 1. internal alwaysinline definition (called F.alwaysinline) 2a. A stub F() { musttail call F.alwaysinline } -- or, depending on the linkage -- 2b. A declaration of F. The frontend ensures that F.inlinefunction is only used for direct calls, and the stub is used for everything else (taking the address of the function, really). Declaration (2b) is emitted in the case when "inline" is meant for inlining only (like __gnu_inline__ and some other cases). This approach, among other nice properties, ensures that alwaysinline functions are always internal, making it impossible for a direct call to such function to produce an undefined symbol reference. This patch is based on ideas by Chandler Carruth and Richard Smith. llvm-svn: 247465
* Record function attribute "stackrealign" instead of using backend optionAkira Hatanaka2015-09-111-2/+2
| | | | | | | | | | | | -force-align-stack. Also, make changes to the driver so that -mno-stack-realign is no longer an option exposed to the end-user that disallows stack realignment in the backend. Differential Revision: http://reviews.llvm.org/D11815 llvm-svn: 247451
* Remove an unnecessary check. NFCAdrian Prantl2015-09-111-1/+1
| | | | llvm-svn: 247448
* Remove a redundant check from CGDebugInfo::shouldOmitDefinition() (NFC).Adrian Prantl2015-09-111-7/+1
| | | | llvm-svn: 247447
* Cleanup: Get rid of a bunch of unnecessary invocations of internString()Adrian Prantl2015-09-111-21/+14
| | | | | | in CGDebugInfo.cpp: MDString::get() copies its arguments. llvm-svn: 247445
* Module Debugging: Emit forward declarations for types that are defined inAdrian Prantl2015-09-112-12/+59
| | | | | | | | | clang modules, if -dwarf-ext-refs (DebugTypesExtRefs) is specified. This reimplements r247369 in about a third of the amount of code. Thanks to David Blaikie pointing this out in post-commit review! llvm-svn: 247432
* Revert "Module Debugging: Emit forward declarations for types that are ↵Adrian Prantl2015-09-112-153/+10
| | | | | | | | defined in" This reverts commit r247369 to facilitate reviewing of the following patch. llvm-svn: 247431
* [CodeGen] Teach SimplifyPersonality about the updated LandingPadInstVedant Kumar2015-09-111-28/+38
| | | | | | | | | | | | | | | When uses of personality functions were moved from LandingPadInst to Function, we forgot to update SimplifyPersonality(). This patch corrects that. Note: SimplifyPersonality() is an optimization which replaces personality functions with the default C++ personality when possible. Without this update, some ObjC++ projects fail to link against C++ libraries (seeing as the exception ABI had effectively changed). rdar://problem/22155434 llvm-svn: 247421
* [OPENMP] Preserve alignment of the original variables for the captured ↵Alexey Bataev2015-09-113-9/+25
| | | | | | | | references. Patch makes codegen to preserve alignment of the shared variables captured and used in OpenMP regions. llvm-svn: 247401
* Fix \param in r247251. [-Wdocumentation]NAKAMURA Takumi2015-09-111-1/+1
| | | | llvm-svn: 247392
* Module Debugging: Emit forward declarations for types that are defined inAdrian Prantl2015-09-112-10/+153
| | | | | | clang modules, if -dwarf-ext-refs (DebugTypesExtRefs) is specified. llvm-svn: 247369
* Cleanup: Let CGDebugInfo::ModuleRefCache use a TrackingMDNode (NFC).Adrian Prantl2015-09-112-7/+7
| | | | llvm-svn: 247368
* Support noreturn in limited contexts on Objective-C message sends.John McCall2015-09-101-11/+60
| | | | | | rdar://6198039 llvm-svn: 247350
* [SEH] Use cleanupendpad so that WinEHPrepare gets the coloring rightReid Kleckner2015-09-104-31/+55
| | | | | | | Cleanupendpad is a lot like catchendpad, so we can reuse the same EHScopeStack type. llvm-svn: 247349
* [MS ABI] Make member pointers return true for isIncompleteTypeDavid Majnemer2015-09-105-21/+5
| | | | | | | The type of a member pointer is incomplete if it has no inheritance model. This lets us reuse more general logic already embedded in clang. llvm-svn: 247346
* Revert "Generating assumption loads of vptr after ctor call (fixed)"Piotr Padlewski2015-09-107-238/+124
| | | | | | | | It seems that there is small bug, and we can't generate assume loads when some virtual functions have internal visibiliy This reverts commit 982bb7d966947812d216489b3c519c9825cacbf2. llvm-svn: 247332
* Add a getDeclContextDescriptor() helper function to CGDebugInfo. (NFC)Adrian Prantl2015-09-102-27/+28
| | | | llvm-svn: 247319
* [SEH] Use catchret in the new EH IR like we do for C++Reid Kleckner2015-09-101-1/+13
| | | | | | Also add tests for SEH with the new IRGen. llvm-svn: 247318
* [CUDA] Postprocess bitcode linked in during device-side CUDA compilation.Artem Belevich2015-09-101-1/+6
| | | | | | | | Link in and internalize the symbols we need from supplied bitcode library. Differential Revision: http://reviews.llvm.org/D11664 llvm-svn: 247317
* [CUDA] Allow trivial constructors as initializer for __shared__ variables.Artem Belevich2015-09-101-2/+4
| | | | | | Differential Revision: http://reviews.llvm.org/D12739 llvm-svn: 247307
* Debug Info: Remove an unnecessary debug type visitor.Adrian Prantl2015-09-101-7/+0
| | | | | | Thanks to dblaikie for spotting this. llvm-svn: 247303
* Re-commit r247218: "Fix Clang-tidy misc-use-override warnings, other minor ↵Hans Wennborg2015-09-102-10/+9
| | | | | | | | fixes" This never broke the build; it was the LLVM side, r247216, that caused problems. llvm-svn: 247302
* [OPENMP] Outlined function for parallel and other regions with list of ↵Alexey Bataev2015-09-105-62/+178
| | | | | | | | | captured variables. Currently all variables used in OpenMP regions are captured into a record and passed to outlined functions in this record. It may result in some poor performance because of too complex analysis later in optimization passes. Patch makes to emit outlined functions for parallel-based regions with a list of captured variables. It reduces code for 2*n GEPs, stores and loads at least. Codegen for task-based regions remains unchanged because runtime requires that all captured variables are passed in captured record. llvm-svn: 247251
* CFI: Introduce -fsanitize=cfi-icall flag.Peter Collingbourne2015-09-104-27/+61
| | | | | | | | | | This flag causes the compiler to emit bit set entries for functions as well as runtime bitset checks at indirect call sites. Depends on the new function bitset mechanism. Differential Revision: http://reviews.llvm.org/D11857 llvm-svn: 247238
* Don't crash when emitting a block under returns_nonnull.John McCall2015-09-101-2/+2
| | | | | | rdar://22071955 llvm-svn: 247228
* Revert r247218: "Fix Clang-tidy misc-use-override warnings, other minor fixes"Hans Wennborg2015-09-102-9/+10
| | | | | | | | | | | Seems it broke the Polly build. From http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3-polly-fast/builds/11687/steps/compile/logs/stdio: In file included from /home/grosser/buildslave/perf-x86_64-penryn-O3-polly-fast/llvm.src/lib/TableGen/Record.cpp:14:0: /home/grosser/buildslave/perf-x86_64-penryn-O3-polly-fast/llvm.src/include/llvm/TableGen/Record.h:369:3: error: looser throw specifier for 'virtual llvm::TypedInit::~TypedInit()' /home/grosser/buildslave/perf-x86_64-penryn-O3-polly-fast/llvm.src/include/llvm/TableGen/Record.h:270:11: error: overriding 'virtual llvm::Init::~Init() noexcept (true)' llvm-svn: 247222
* Fix Clang-tidy misc-use-override warnings, other minor fixesHans Wennborg2015-09-102-10/+9
| | | | | | | | Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D12741 llvm-svn: 247218
* ARC: Fix the precise-lifetime suppression of returns_inner_pointerJohn McCall2015-09-091-0/+13
| | | | | | | | receiver extension for message sends via property syntax. rdar://22172983 llvm-svn: 247209
OpenPOWER on IntegriCloud