summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX
Commit message (Collapse)AuthorAgeFilesLines
...
* [MS ABI] Add support for mangling VLA typesDavid Majnemer2015-04-231-0/+4
| | | | | | Treat a VLA type like an incomplete array type. llvm-svn: 235575
* [MS ABI] Treat ConstantArrayType like IncompleteArrayType in argsDavid Majnemer2015-04-231-0/+5
| | | | | | | | | | | | | Type backreferences for arguments use the DecayedType's original type. Because of this, arguments with the same canonical type with the same mangling would not backreference each other if one was a ConstantArrayType while the other was an IncompleteArrayType. Solve this by canonicalizing the ConstantArrayType to a suitable IncompleteArrayType. This fixes PR23325. llvm-svn: 235572
* [WinEH] Don't emit an exceptional cleanup for llvm.eh.endcatchReid Kleckner2015-04-221-0/+36
| | | | | | | | | These extra endcatch markers aren't helping identify regions to outline, so let's get rid of them. LLVM outlines (more or less) from begincatch to endcatch. Any unwind edge from an enclosed invoke is a transition to a new exception handler, which has it's own outlining markers. llvm-svn: 235562
* Revert "Revert r234581, it might have caused a few miscompiles in Chromium."David Majnemer2015-04-222-3/+17
| | | | | | | | This reverts commit r234700. It turns out that the lifetime markers were not the cause of Chromium failing but a bug which was uncovered by optimizations exposed by the markers. llvm-svn: 235553
* Set normal LLVM function attributes on global initializer functionsReid Kleckner2015-04-222-3/+10
| | | | | | | | | | | Otherwise -fno-omit-frame-pointer and other flags like it aren't applied. Basic idea taken from Gao's patch, thanks! Differential Revision: http://reviews.llvm.org/D9203 llvm-svn: 235537
* Don't dllimport/export class members with internal linkage (PR23308)Hans Wennborg2015-04-221-0/+9
| | | | | | | | | | For example, a function taking a parameter with internal linkage will itself have internal linkage since it cannot be called outside the translation unit. Differential Revision: http://reviews.llvm.org/D9182 llvm-svn: 235471
* [MS ABI] Use the right types for filter and finally blocksDavid Majnemer2015-04-171-3/+3
| | | | | | | The type for abnormal_termination can't be an i1, it an i8. Filter functions return 'LONG', not 'int'. llvm-svn: 235161
* [opaque pointer types] Explicit non-pointer type for call expressionsDavid Blaikie2015-04-1614-39/+39
| | | | | | (migration for recent LLVM change to textual IR for calls) llvm-svn: 235147
* Revert "[CodeGen] Fix crash with duplicated mangled name."Renato Golin2015-04-152-19/+0
| | | | | | | | | This reverts commit r234767, as it was breaking all ARM buildbots for two days and the assert is not in the code, making it difficult to spot the error, which would keep the bots red for a few more days. New errors were silently introduced because of this bug, and we don't want this to escalate. llvm-svn: 234983
* Move the logic to avoid double global emission from Sema to CodeGenReid Kleckner2015-04-151-0/+14
| | | | | | | | | | | Reverts the code changes from r234675 but keeps the test case. We were already maintaining a DenseMap of globals with dynamic initializers anyway. Fixes the test case from PR23234. llvm-svn: 234961
* Reland r234613 (and follow-ups 234614, 234616, 234618)Reid Kleckner2015-04-141-0/+44
| | | | | | | The frameescape intrinsic cannot be inlined, so I fixed the inliner in r234937. This should address PR23216. llvm-svn: 234942
* Revert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.Nico Weber2015-04-131-44/+0
| | | | llvm-svn: 234789
* Revert r234786, it contained a bunch of stuff I did not mean to commit.Nico Weber2015-04-131-0/+44
| | | | llvm-svn: 234787
* Revert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.Nico Weber2015-04-131-44/+0
| | | | llvm-svn: 234786
* [CodeGen] Fix crash with duplicated mangled name.Argyrios Kyrtzidis2015-04-132-0/+19
| | | | | | Patch by Yunzhong Gao! llvm-svn: 234767
* Revert r234581, it might have caused a few miscompiles in Chromium.Nico Weber2015-04-112-17/+3
| | | | | | | If the revert helps, I'll get a repro this Monday. Else I'll put the change back in. llvm-svn: 234700
* clang/test/CodeGenCXX/static-data-member-single-emission.cpp: Tweak for MS ↵NAKAMURA Takumi2015-04-111-0/+1
| | | | | | mangler. llvm-svn: 234687
* Only notify consumers about static data members of class templates onceReid Kleckner2015-04-111-0/+30
| | | | llvm-svn: 234675
* [SEH] Add test for inline functions using SEH helpersReid Kleckner2015-04-101-0/+44
| | | | | | | Such helpers should always be comdat with the parent function and have internal linkage. llvm-svn: 234618
* Remove threshold for inserting lifetime markers for named temporariesArnaud A. de Grandmaison2015-04-102-3/+17
| | | | | | | | | | | | | | | | | | | Now that TailRecursionElimination has been fixed with r222354, the threshold on size for lifetime marker insertion can be removed. This only affects named temporary though, as the patch for unnamed temporaries is still in progress. My previous commit (r222993) was not handling debuginfo correctly, but this could only be seen with some asan tests. Basically, lifetime markers are just instrumentation for the compiler's usage and should not affect debug information; however, the cleanup infrastructure was assuming it contained only destructors, i.e. actual code to be executed, and was setting the breakpoint for the end of the function to the closing '}', and not the return statement, in order to show some destructors have been called when leaving the function. This is wrong when the cleanups are only lifetime markers, and this is now fixed. llvm-svn: 234581
* Update test case for r234543.Benjamin Kramer2015-04-091-1/+1
| | | | llvm-svn: 234544
* [CodeGen] Do a more principled fix for PR231653, always use the inner type.Benjamin Kramer2015-04-092-4/+13
| | | | | | | We were still using the MaterializeTemporaryExpr's type to check if the transform is legal. Always use the inner Expr type. llvm-svn: 234543
* [CodeGen] When promoting a reference temporary to a global use the inner ↵Benjamin Kramer2015-04-091-0/+21
| | | | | | | | | type to fold it. The MaterializeTemporaryExpr can have a different type than the inner expression, miscompiling the constant. PR23165. llvm-svn: 234499
* [WinEH] Don't wrap cleanups in terminate actionsReid Kleckner2015-04-081-1/+24
| | | | | | | | _CxxFrameHandler3 calls terminate if a cleanup action throws, regardless of what bits you put in the xdata tables. There's no need to model this in the IR, since we just have to take it out later. llvm-svn: 234448
* Reland "[SEH] Implement filter capturing in CodeGen"Reid Kleckner2015-04-081-0/+80
| | | | | | | | | | | The test should be fixed. It was failing in NDEBUG builds due to a missing '*' character in a regex. In asserts builds, the pattern matched a single digit value, which became a double digit value in NDEBUG builds. Go figure. This reverts commit r234261. llvm-svn: 234447
* Revert "Mark instantiated function decls as inline specified if any pattern is"Reid Kleckner2015-04-071-33/+0
| | | | | | | | | | | | | | | | | | | It breaks down on this test case: void foo(); template <typename T> class C { friend void foo(); }; inline void foo() {} C<int> c; We shouldn't be marking the instantiation of the friend decl of foo as inline-specified. It may be possible to fix this by determining if the full definition is part of the current template, but it seems better to rever tot green until we come up with a full solution. This reverts commit r233817, as well as follow-ups r233820 and r233821. llvm-svn: 234355
* Revert "[SEH] Implement filter capturing in CodeGen"Daniel Jasper2015-04-071-81/+0
| | | | | | | Test fails: http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/3182/ llvm-svn: 234306
* [WinEH] Don't create an alloca for unnamed catch parametersReid Kleckner2015-04-072-1/+13
| | | | | | | | The catch object parameter to llvm.eh.begincatch is optional, and can be null. We can save some ourselves the stack space, copy ctor, and dtor calls if we pass null. llvm-svn: 234264
* [SEH] Implement filter capturing in CodeGenReid Kleckner2015-04-061-0/+81
| | | | | | | | | | | | | | | While capturing filters aren't very common, we'd like to outline __finally blocks in the frontend to simplify -O0 EH preparation and reduce code size. Finally blocks are usually have captures, and this is the first step towards that. Currently we don't support capturing 'this' or VLAs. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D8825 llvm-svn: 234261
* [MS ABI] A pointer-to-function cannot be caught as a pointer-to-voidDavid Majnemer2015-04-041-0/+9
| | | | | | | | Don't assume that all pointers are convertible to void pointer. Instead correctly respect [conv.ptr]p2; only allow pointer types with an object pointee type to be caught as pointer-to-void. llvm-svn: 234090
* [i386 ABI] expand small C like structs in C++, just like how we handle smallManman Ren2015-04-032-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | C structs. This comes up when we have a function that takes a struct and is defined in a C++ file and used in a C file. Before this commit, we will generate byval for C++ and will expand the struct for C, thus causing difference at IR level. We will use bitcast of function type at the callsite, which causes the inliner to not inline the function. This commit changes how we handle small C like structs at IR level, but at backend, we should generate the same argument passing before and after the commit. Note that the condition for expanding is still over conservative. We should be able to expand type that is spelled with “class” and types that are not C-like. But this commit fixes the inconsistent argument passing between C/C++. Reviewed by John. rdar://20121030 llvm-svn: 234033
* Implement CFI type checks for non-virtual calls.Peter Collingbourne2015-04-022-3/+38
| | | | | | | | | | | | This uses the same class metadata currently used for virtual call and cast checks. The new flag is -fsanitize=cfi-nvcall. For consistency, the -fsanitize=cfi-vptr flag has been renamed -fsanitize=cfi-vcall. Differential Revision: http://reviews.llvm.org/D8756 llvm-svn: 233874
* Re-land "MS ABI: lambda call operators are instance methods and should use ↵Reid Kleckner2015-04-012-12/+12
| | | | | | | | | | | | | thiscall" Update the test cases to pass when lambda call operators use thiscall. Update the lambda-to-block conversion operator to use the default free function calling convention instead of the call operator's convention. This reverts commit r233082 and re-instates r233023. llvm-svn: 233835
* Fix inlinehint.cpp with an explicit triple to avoid x86_thiscallcc problemsReid Kleckner2015-04-011-2/+1
| | | | llvm-svn: 233821
* Remove comdats from inlinehint.cpp to pass test on DarwinReid Kleckner2015-04-011-5/+6
| | | | llvm-svn: 233820
* Mark instantiated function decls as inline specified if any pattern isReid Kleckner2015-04-011-0/+33
| | | | | | | | | | | | A function template pattern can be declared without the 'inline' specifier and defined later with the 'inline' specifier. However, during instantiation, we were only looking at the canonical decl to see if we should mark the instantiated decl as inline specified. Since the instantiated decl actually represents many pattern declarations, put the inline specifier on the instantiation decl if any of the pattern decls have it. llvm-svn: 233817
* [MS ABI] Disregard restrictive exception specificationsDavid Majnemer2015-04-011-0/+8
| | | | | | | | | | | MSVC treats all non-empty exception specifications the same way: all exceptions are permitted. The .xdata tables provide a way to efficiently lower exception specifications *but* this probably has to be implemented as a catch-all/rethrow mechanism instead of the Itanium way. This fixes PR23092. llvm-svn: 233787
* [MS ABI] Rework .xdata HandlerType emissionDavid Majnemer2015-03-291-3/+3
| | | | | | | | | | Utilizing IMAGEREL relocations for synthetic IR constructs isn't valuable, just clutter. While we are here, simplify HandlerType names by making the numeric value for the 'adjective' part of the mangled name instead of appending '.const', etc. The old scheme made for very long global names and leads to wordy things like '.std_bad_alloc' llvm-svn: 233503
* Remove test for PR12917 for now. I'm relatively sure this is ill-formed per ↵Benjamin Kramer2015-03-271-22/+0
| | | | | | [dcl.fct.default]p3. llvm-svn: 233379
* Reverting r233023 -- it caused test failures on Windows with MSVC x86.Aaron Ballman2015-03-241-5/+5
| | | | | | http://bb.pgr.jp/builders/ninja-clang-i686-msc18-R/builds/572 llvm-svn: 233082
* MS ABI: lambda call operators are instance methods and should use thiscallReid Kleckner2015-03-231-5/+5
| | | | | | Fixes an issue reported by Daniel Berenyi on cfe-dev. llvm-svn: 233023
* C++14: Disable sized deallocation by default due to ABI breakageReid Kleckner2015-03-203-98/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are no widely deployed standard libraries providing sized deallocation functions, so we have to punt and ask the user if they want us to use sized deallocation. In the future, when such libraries are deployed, we can teach the driver to detect them and enable this feature. N3536 claimed that a weak thunk from sized to unsized deallocation could be emitted to avoid breaking backwards compatibility with standard libraries not providing sized deallocation. However, this approach and other variations don't work in practice. With the weak function approach, the thunk has to have default visibility in order to ensure that it is overridden by other DSOs providing sized deallocation. Weak, default visibility symbols are particularly expensive on MachO, so John McCall was considering disabling this feature by default on Darwin. It also changes behavior ELF linking behavior, causing certain otherwise unreferenced object files from an archive to be pulled into the link. Our second approach was to use an extern_weak function declaration and do an inline conditional branch at the deletion call site. This doesn't work because extern_weak only works on MachO if you have some archive providing the default value of the extern_weak symbol. Arranging to provide such an archive has the same challenges as providing the symbol in the standard library. Not to mention that extern_weak doesn't really work on COFF. Reviewers: rsmith, rjmccall Differential Revision: http://reviews.llvm.org/D8467 llvm-svn: 232788
* Don't crash-on-valid when an inline function is friend of class templateDavid Majnemer2015-03-201-0/+15
| | | | | | | | | We assumed that the most recent declaration of an inline function would also be inline. However, a more recent declaration can come from a friend declaration in a class template that is instantiated at the definition of the function. llvm-svn: 232786
* MS ABI: Implement the MSVC 2015 scheme for scope disambiguationDavid Majnemer2015-03-193-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consider C++ that looks like: inline int &f(bool b) { if (b) { static int i; return i; } static int i; return i; } Both 'i' variables must have distinct (and stable) names for linkage purposes. The MSVC 2013 ABI would number the variables using a count of the number of scopes that have been created. However, the final 'i' returns to a scope that has already been created leading to a mangling collision. MSVC 2015 fixes this by giving the second 'i' the name it would have if it were declared before the 'if'. However, this results in ABI breakage because the mangled name, in cases where there was no ambiguity, would now be different. We implement the new behavior and only enable it if we are targeting the MSVC 2015 ABI, otherwise the old behavior will be used. This fixes PR18131. llvm-svn: 232766
* Revert "Improvement on sized deallocation from r230160"Reid Kleckner2015-03-193-55/+33
| | | | | | | | | This reverts commit r230580. extern_weak functions don't appear to work on Darwin (PR22951), so we'll need to come up with a new approach. llvm-svn: 232731
* MS ABI: Don't try to emit VF/VB-Tables for extern class templatesDavid Majnemer2015-03-182-3/+24
| | | | | | | | | There will be an explicit template instantiation in another translation unit which will provide the definition of the VF/VB-Tables. This fixes PR22932. llvm-svn: 232680
* MS ABI: Empty pack expansions had their mangling changed in 2013->2015David Majnemer2015-03-181-3/+6
| | | | | | | | | | We used to support the 2013 mangling and changed it to the more reasonable 2015 mangling. Let's make the mangling conditional on what version of MSVC is targeted. This fixes PR21888. llvm-svn: 232609
* Fix test in release mode. This reapplies r232456, corresponding to r232579.NAKAMURA Takumi2015-03-181-1/+1
| | | | llvm-svn: 232582
* Fix the LLVM type used when lowering initializer list reference temporaries ↵Nick Lewycky2015-03-181-0/+33
| | | | | | to global variables. Reapplies r232454 with fix for PR22940. llvm-svn: 232579
* MS ABI: Build C++ default argument exprs for exported template classesReid Kleckner2015-03-171-0/+9
| | | | | | This was an omission from r232229. llvm-svn: 232554
OpenPOWER on IntegriCloud