summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX
Commit message (Collapse)AuthorAgeFilesLines
* [TLS on Darwin] use CXX_FAST_TLS calling convention for access functions.Manman Ren2015-12-173-15/+23
| | | | | | | | Also set nounwind attribute. rdar://problem/9001553 llvm-svn: 255860
* Print qualified display names when emitting CodeViewReid Kleckner2015-12-161-0/+73
| | | | | | This is what debuggers expect. Words towards fixing PR21528. llvm-svn: 255744
* Reland "[SEH] Use llvm.x86.seh.recoverfp for SEH filters on x64 as well as ↵Reid Kleckner2015-12-161-4/+7
| | | | | | | | 32bit" I forgot to initialize RecoverFP. llvm-svn: 255731
* Revert "[SEH] Use llvm.x86.seh.recoverfp for SEH filters on x64 as well as ↵Reid Kleckner2015-12-161-7/+4
| | | | | | | | 32bit" This reverts commit r255710. llvm-svn: 255728
* Relax checks in cfi-cross-dso test.Evgeniy Stepanov2015-12-151-2/+2
| | | | | | The test is failing with unnamed labels. llvm-svn: 255712
* [SEH] Use llvm.x86.seh.recoverfp for SEH filters on x64 as well as 32bitReid Kleckner2015-12-151-4/+7
| | | | llvm-svn: 255710
* Cross-DSO control flow integrity (Clang part).Evgeniy Stepanov2015-12-151-0/+45
| | | | | | | | | | | | | | Clang-side cross-DSO CFI. * Adds a command line flag -f[no-]sanitize-cfi-cross-dso. * Links a runtime library when enabled. * Emits __cfi_slowpath calls is bitset test fails. * Emits extra hash-based bitsets for external CFI checks. * Sets a module flag to enable __cfi_check generation during LTO. This mode does not yet support diagnostics. llvm-svn: 255694
* [MS ABI] Don't rely on terminatepadDavid Majnemer2015-12-142-3/+5
| | | | | | | | | | | | | | | We'd like to remove support for terminatepad from LLVM. To do this, we need to move Clang off of it first. The intent behind terminatepad was to carefully model exception specifications for the MSVC personality. However, we don't support exception specifications for the MSVC personality and neither does MSVC. Instead, MSVC supports all-or-nothing exception specifications. We can model this limited usage using cleanuppads which call std::terminate. Differential Revision: http://reviews.llvm.org/D15478 llvm-svn: 255521
* Try to appease a buildbot.David Majnemer2015-12-121-2/+2
| | | | llvm-svn: 255424
* Update clang to use the updated LLVM EH instructionsDavid Majnemer2015-12-128-74/+55
| | | | | | | | | | Depends on D15139. Reviewers: rnk Differential Revision: http://reviews.llvm.org/D15140 llvm-svn: 255423
* Do not generate DW_TAG_imported_module for anonymous namespaces (even ↵Ekaterina Romanova2015-12-101-0/+26
| | | | | | | | | | nested) for all the platforms except PS4. For PS4, generate explicit import for anonymous namespaces and mark it by DW_AT_artificial attribute. Differential Revision: http://reviews.llvm.org/D12624 llvm-svn: 255281
* [MSVC] Fix for http://llvm.org/PR25636: indexed accessor property not ↵Alexey Bataev2015-12-101-7/+9
| | | | | | | | | supported correctly. All problems described in http://llvm.org/PR25636 are implemented except for return value of the 'put' property. This patch fixes this problem with the indexed properties Differential Revision: http://reviews.llvm.org/D15174 llvm-svn: 255218
* Add tests for pass_object_size.George Burgess IV2015-12-031-0/+27
| | | | | | | | These additions were meant to go in as a part of r254554; while it's certainly nice to have new functionality, it's nicer if we have tests to go with it. :) llvm-svn: 254632
* Unxfail passing test: test/CodeGenCXX/crash.cppKrzysztof Parzyszek2015-12-031-1/+0
| | | | llvm-svn: 254606
* Add the `pass_object_size` attribute to clang.George Burgess IV2015-12-021-0/+19
| | | | | | | | | | | | | `pass_object_size` is our way of enabling `__builtin_object_size` to produce high quality results without requiring inlining to happen everywhere. A link to the design doc for this attribute is available at the Differential review link below. Differential Revision: http://reviews.llvm.org/D13263 llvm-svn: 254554
* [MS ABI] Correctly mangle nullptr member pointers for variable templatesDavid Majnemer2015-12-011-8/+15
| | | | | | | Variable templates behave the same as class templates with regard to nullptr memeber pointers. llvm-svn: 254439
* Fix use-after-free when a C++ thread_local variable gets replaced (because itsRichard Smith2015-12-011-0/+12
| | | | | | | type changes when the initializer is attached). Don't hold onto the GlobalVariable*; recompute it from the VarDecl* instead. llvm-svn: 254359
* [MSVC] 'property' with an empty array in array subscript expression.Alexey Bataev2015-11-251-0/+92
| | | | | | | | | | | | MSVC supports 'property' attribute and allows to apply it to the declaration of an empty array in a class or structure definition. For example: ``` __declspec(property(get=GetX, put=PutX)) int x[]; ``` The above statement indicates that x[] can be used with one or more array indices. In this case, i=p->x[a][b] will be turned into i=p->GetX(a, b), and p->x[a][b] = i will be turned into p->PutX(a, b, i); Differential Revision: http://reviews.llvm.org/D13336 llvm-svn: 254067
* Preserve exceptions information during calls code generation.Samuel Antao2015-11-231-0/+47
| | | | | | | | | | | This patch changes the generation of CGFunctionInfo to contain the FunctionProtoType if it is available. This enables the code generation for call instructions to look into this type for exception information and therefore generate better quality IR - it will not create invoke instructions for functions that are know not to throw. llvm-svn: 253926
* [MS ABI] Tolerate invokes of __RTDynamicCastDavid Majnemer2015-11-231-1/+20
| | | | | | | | | | | | The pointer returned by __RTDynamicCast must be bitcasted. However, it was not expected that __RTDynamicCast would be invoked, resulting in the bitcast occuring in a different BasicBlock than the invoke. This caused a down-stream PHI to get confused about which BasicBlock the incomming value was from. This fixes PR25606. llvm-svn: 253843
* [DebugInfo] Look through type sugar on union types when castingReid Kleckner2015-11-201-0/+17
| | | | | | Fixes PR25584. llvm-svn: 253680
* Revert "Change memcpy/memset/memmove to have dest and source alignments."Pete Cooper2015-11-1918-90/+90
| | | | | | | | | | This reverts commit r253512. This likely broke the bots in: http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/20202 http://bb.pgr.jp/builders/clang-3stage-i686-linux/builds/3787 llvm-svn: 253542
* [MS ABI] Let arbitrary entities participate in vftable orderingDavid Majnemer2015-11-191-0/+15
| | | | | | | | | | | In the Microsoft ABI, the vftable is laid out in the order in the declaration order of the entities defined within it. Obviously, only virtual methods end up in the vftable but they will be placed into the table at the same position as the first entity with the same name. llvm-svn: 253523
* Change memcpy/memset/memmove to have dest and source alignments.Pete Cooper2015-11-1818-90/+90
| | | | | | | | | | | | | | | | | | | | | | This is a follow on from a similar LLVM commit: r253511. Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html These intrinsics currently have an explicit alignment argument which is required to be a constant integer. It represents the alignment of the source and dest, and so must be the minimum of those. This change allows source and dest to each have their own alignments by using the alignment attribute on their arguments. The alignment argument itself is removed. The only code change to clang is hidden in CGBuilder.h which now passes both dest and source alignment to IRBuilder, instead of taking the minimum of dest and source alignments. Reviewed by Hal Finkel. llvm-svn: 253512
* [CGDebugInfo] Set the size and align for reference typesKeno Fischer2015-11-161-1/+1
| | | | | | | | | | In r253186, I changed the DIBuilder API to now take size and align for reference types as well. This was done in preparation for upcoming changes to the Verifier that will validate that sizes match between DI types and IR values that are declared as having those types. This updates clang to actually pass the information through. llvm-svn: 253190
* Make some tests LLVM-optimization agnostic and remove some others that were ↵David Blaikie2015-11-143-111/+0
| | | | | | | | | | | | | | | | beyond value/repair Several of these tests (the two deleted, and the one removal edit) were relying on the optimizer to collapse things to test some frontend feature. The tests were really old and features seemed amply covered by other parts of the test suite, so I just removed them. If anyone thinks they're valuable enough to keep/fix, we can play around with that, for sure. (inspired by r252872) llvm-svn: 253114
* Slacken the norecurse test slightlyJames Molloy2015-11-131-1/+1
| | | | | | | | It has been reported that this test currently fails on some Power buildbots due to them adding a "signext" function attribute. As that's not what we're checking here, slacken off the test a bit. llvm-svn: 253055
* Add support for function attribute 'disable_tail_calls'.Akira Hatanaka2015-11-131-0/+35
| | | | | | | | | | | | | | | | | | | | | | The ``disable_tail_calls`` attribute instructs the backend to not perform tail call optimization inside the marked function. For example, int callee(int); int foo(int a) __attribute__((disable_tail_calls)) { return callee(a); // This call is not tail-call optimized. } Note that this attribute is different from 'not_tail_called', which prevents tail-call optimization to the marked function. rdar://problem/8973573 Differential Revision: http://reviews.llvm.org/D12547 llvm-svn: 252986
* [C++] Add the "norecurse" attribute to main() if in C++ modeJames Molloy2015-11-121-0/+8
| | | | | | The C++ spec (3.6.1.3) says "The function `main` shall not be used within a program". This implies that it cannot recurse, so add the norecurse attribute to help the midend out a bit. llvm-svn: 252902
* Update clang regression tests for 'norecurse'James Molloy2015-11-123-3/+3
| | | | | | FunctionAttrs has just been taught how to infer 'norecurse'. Update clang tests for LLVM r252871. llvm-svn: 252872
* [TLS on Darwin] change how we handle globals with linkonce or weak linkage.Manman Ren2015-11-113-26/+44
| | | | | | | | | | | | This is about how we handle static member of a template. Before this commit, we use internal linkage for the IR thread-local variable, which is inefficient. With this commit, we will start to follow Itanium C++ ABI. rdar://problem/23415206 Reviewed by John McCall. llvm-svn: 252814
* [TLS] move setting tls_guard in tls_init.Manman Ren2015-11-111-1/+1
| | | | | | | | We used to emit the store prior to branch in the entry block. To make it more efficient, this commit moves it to the init block. We still mark as initialized before initializing anything else. llvm-svn: 252777
* [COFF] Don't try to emit weak aliases on COFFReid Kleckner2015-11-101-0/+16
| | | | | | | | | | | | | | | | | This comes up when a derived class destructor is equivalent to a base class destructor defined in the same TU, and we try to alias them. A COFF weak alias cannot satisfy a normal undefined symbol reference from another TU. The other TU must also mark the referenced symbol as weak, and we can't rely on that. Clang already has a special case here for dllexport, but we failed to realize that the problem also applies to other non-discardable symbols such as those from explicit template instantiations. Fixes PR25477. llvm-svn: 252659
* Implement __attribute__((internal_linkage)).Evgeniy Stepanov2015-11-101-0/+79
| | | | | | | | | | | | | | The attrubite is applicable to functions and variables and changes the linkage of the subject to internal. This is the same functionality as C-style "static", but applicable to class methods; and the same as anonymouns namespaces, but can apply to individual methods of a class. Following the proposal in http://lists.llvm.org/pipermail/cfe-dev/2015-October/045580.html llvm-svn: 252648
* Add support for function attribute 'not_tail_called'.Akira Hatanaka2015-11-061-0/+17
| | | | | | | | | | | | | | | | | | | | | | This attribute is used to prevent tail-call optimizations to the marked function. For example, in the following piece of code, foo1 will not be tail-call optimized: int __attribute__((not_tail_called)) foo1(int); int foo2(int a) { return foo1(a); // Tail-call optimization is not performed. } The attribute has effect only on statically bound calls. It has no effect on indirect calls. Also, virtual functions and objective-c methods cannot be marked as 'not_tail_called'. rdar://problem/22667622 Differential Revision: http://reviews.llvm.org/D12922 llvm-svn: 252369
* CodeGen: Update for debug info API change.Peter Collingbourne2015-11-054-9/+9
| | | | | | Differential Revision: http://reviews.llvm.org/D14266 llvm-svn: 252220
* [MS ABI] Don't zero-initialize vbptrs in basesDavid Majnemer2015-11-021-0/+26
| | | | | | | | | | | | Certain CXXConstructExpr nodes require zero-initialization before a constructor is called. We had a bug in the case where the constructor is called on a virtual base: we zero-initialized the base's vbptr field. A complementary bug is present in MSVC where no zero-initialization occurs for the subobject at all. This fixes PR25370. llvm-svn: 251783
* [CodeGen] Call SetInternalFunctionAttributes to attach functionAkira Hatanaka2015-10-311-0/+12
| | | | | | | | | | | | | | | | | attributes to internal functions. This patch fixes CodeGenModule::CreateGlobalInitOrDestructFunction to use SetInternalFunctionAttributes instead of SetLLVMFunctionAttributes to attach function attributes to internal functions. Also, make sure the correct CGFunctionInfo is passed instead of always passing what arrangeNullaryFunction returns. rdar://problem/20828324 Differential Revision: http://reviews.llvm.org/D13610 llvm-svn: 251734
* ARMv7k: implement ABI changes for watchOS from standard iOS.Tim Northover2015-10-301-0/+68
| | | | llvm-svn: 251710
* [WinEH] Mark calls inside cleanups as noinlineReid Kleckner2015-10-281-10/+14
| | | | | | | | | | | | | | | This works around PR25162. The MSVC tables make it very difficult to correctly inline a C++ destructor that contains try / catch. We've attempted to address PR25162 in LLVM's backend, but it feels pretty infeasible. MSVC and ICC both appear to avoid inlining such complex destructors. Long term, we want to fix this by making the inliner smart enough to know when it is inlining into a cleanup, so it can inline simple destructors (~unique_ptr and ~vector) while avoiding destructors containing try / catch. llvm-svn: 251576
* [MS ABI] Mangle static anonymous unionsDavid Majnemer2015-10-221-0/+9
| | | | | | | | | | | | We believed that internal linkage variables at global scope which are not variable template specializations did not have to be mangled. However, static anonymous unions have no identifier and therefore must be mangled. This fixes PR18204. llvm-svn: 250997
* [Driver] Alias -fvisibility=internal to -fvisibility=hiddenReid Kleckner2015-10-211-0/+3
| | | | | | | | | | | | | | | | | | 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
* [DEBUG INFO] Emit debug info for type used in explicit cast only.Alexey Bataev2015-10-201-0/+46
| | | | | | | Currently debug info for types used in explicit cast only is not emitted. It happened after a patch for better alignment handling. This patch fixes this bug. Differential Revision: http://reviews.llvm.org/D13582 llvm-svn: 250795
* [MS ABI] Give linkonce_odr, instead of external_linkage, to certain kinds of ↵David Majnemer2015-10-192-8/+8
| | | | | | | | | | | | | | | | | static data members Out-of-line definitions of static data members which have an inline initializer must get GVA_DiscardableODR linkage instead of GVA_StrongExternal linkage. MSVC 2013's behavior is different with respect to this and would cause link errors if one TU provided a definition while another did not. MSVC 2015 fixed this bug, making this OK. Note that the 2015 behavior is always compatible with 2013: it never produces a strong definition. This essentially reverts r237787. llvm-svn: 250757
* [Sema] Fix address-of + enable_if overloading logicGeorge Burgess IV2015-10-161-0/+9
| | | | | | | | | | | | | | | | | Previously, our logic when taking the address of an overloaded function would not consider enable_if attributes, so long as all of the enable_if conditions on a given candidate were true. So, two functions with identical signatures (one with enable_if attributes, the other without), would be considered equally good overloads. If we were calling the function instead of taking its address, then the function with enable_if attributes would be preferred. This patch makes us prefer the candidate with enable_if regardless of if we're calling or taking the address of an overloaded function. Differential Revision: http://reviews.llvm.org/D13795 llvm-svn: 250486
* [MSVC] Fix for http://llvm.org/PR24132: __declspec(property): double ↵Alexey Bataev2015-10-141-0/+19
| | | | | | | | | invocations of foo() when compiling foo()->propertyName Removes extra codegen for base expression of MS property call Differential Revision: http://reviews.llvm.org/D13375 llvm-svn: 250265
* [WinEH] Push cleanupendpad scopes around exceptional cleanupsReid Kleckner2015-10-081-6/+24
| | | | | | | We were only doing this for SEH as a special case. Generalize it to all cleanups. llvm-svn: 249748
* Update tests touched by r249656David Majnemer2015-10-081-3/+3
| | | | | | | | | These test updates almost exclusively around the change in behavior around enum: enums without a definition are considered incomplete except when targeting MSVC ABIs. Since these tests are interested in the 'incomplete-enum' behavior, restrict them to %itanium_abi_triple. llvm-svn: 249660
* [MSVC Compat] Enable ABI impacting non-conforming behavior independently of ↵David Majnemer2015-10-081-19/+31
| | | | | | | | | | -fms-compatibility No ABI for C++ currently makes it possible to implement the standard 100% perfectly. We wrongly hid some of our compatible behavior behind -fms-compatibility instead of tying it to the compiler ABI. llvm-svn: 249656
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-0878-92/+91
| | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud