summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* MS ABI: Pass 'sret' as the second parameter of instance methodsReid Kleckner2014-05-095-20/+76
| | | | | | | | | | | | | | | | | Summary: MSVC always passes 'sret' after 'this', unlike GCC. This required changing a number of places in Clang that assumed the sret parameter was always first in LLVM IR. This fixes win64 MSVC ABI compatibility for methods returning structs. Reviewers: rsmith, majnemer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3618 llvm-svn: 208458
* Pacify bots again - turns out my checkout was slightly polluted when I was ↵James Molloy2014-05-091-1/+1
| | | | | | reverting a olista01s change, and this pollution made it upstream during the revert checkin :/ Sorryemacs -nw lib/CodeGen/CodeGenModule.cpp llvm-svn: 208426
* Reapply r208417 (olista01 'ARM: HFAs must be passed in consecutive ↵James Molloy2014-05-092-27/+40
| | | | | | registers'). Bots are now pacified. llvm-svn: 208425
* Revert r208417 (olista01 'ARM: HFAs must be passed in consecutive ↵James Molloy2014-05-093-41/+28
| | | | | | registers'). This is a followon commit from r208413 which broke the LLVM bots. llvm-svn: 208422
* ARM: HFAs must be passed in consecutive registersOliver Stannard2014-05-092-27/+40
| | | | | | | This is the clang counterpart to 208413, which ensures that Homogeneous Floating-point Aggregates are passed in consecutive registers on ARM. llvm-svn: 208417
* Don't repeat function name in comment.Rafael Espindola2014-05-091-192/+149
| | | | llvm-svn: 208387
* Don't indent in namespaces.Rafael Espindola2014-05-092-148/+145
| | | | llvm-svn: 208384
* Simplify the code a bit by using linkage predicates.Rafael Espindola2014-05-091-4/+4
| | | | llvm-svn: 208382
* Don't indent inside namespaces.Rafael Espindola2014-05-093-204/+205
| | | | llvm-svn: 208377
* Use auto to avoid duplicating the type.Rafael Espindola2014-05-094-160/+145
| | | | llvm-svn: 208374
* CodeGen: fix code model mappingSaleem Abdulrasool2014-05-081-1/+1
| | | | | | | | Large is CodeModel::Model::Large, not CodeModel::Model::Medium. Thanks to majnemer for pointing out the typo! Its unclear how to test the mapped value in the compiler, the tests already cover the driver side. llvm-svn: 208335
* Simplify a few cast<>s.Rafael Espindola2014-05-081-9/+12
| | | | llvm-svn: 208331
* Cleanup setFunctionDefinitionAttributes.Rafael Espindola2014-05-083-15/+10
| | | | | | Use more specific type, update comments and name style. llvm-svn: 208328
* Replace virtual with override.Rafael Espindola2014-05-081-2/+2
| | | | llvm-svn: 208324
* Use more specific type.Rafael Espindola2014-05-081-2/+2
| | | | llvm-svn: 208321
* Small simplification: Reduce the use of cast<>.Rafael Espindola2014-05-081-24/+24
| | | | llvm-svn: 208320
* Fix segmentation fault when mixing -Rpass with #line.Diego Novillo2014-05-081-3/+10
| | | | | | | | | | | | | | | | | | | Summary: When using #line directives, FileManager::getFile() will return a nil entry. This triggers an assert in translateFileLineCol(). This patch handles nil FileEntry instances by emitting a note that the location could not be translated back to a SourceLocation. I don't really like this solution, but we are translating presumed locations, so some information has already been lost. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3625 llvm-svn: 208315
* Use predicate function to simplify a bit.Rafael Espindola2014-05-081-2/+1
| | | | llvm-svn: 208312
* Driver: parse -mcmodel earlierSaleem Abdulrasool2014-05-081-14/+11
| | | | | | | | | | | This addresses an existing FIXME item in the driver. The code model flag was parsed in the actual tool rather than in the driver. This was problematic since the value may be invalid. In that case, we would silently treat it as a default value in non-assert builds, and abort in assert builds. Add a check in the driver to validate that the value being passed is valid, and if not provide a proper error message. llvm-svn: 208275
* CodeGen: Don't set hidden visibility on symbols with local linkageDuncan P. N. Exon Smith2014-05-072-2/+6
| | | | llvm-svn: 208258
* When doing int<->ptr coercion for big-endian, calculate the shift amount ↵James Molloy2014-05-071-2/+3
| | | | | | | | | | | | | | | correctly. Previously we calculated the shift amount based upon DataLayout::getTypeAllocSizeInBits. This will only work for legal types - types such as i24 that are created as part of structs for bitfields will return "32" from that function. Change to using getTypeSizeInBits. It turns out that AArch64 didn't run across this problem because it always returned [1 x i64] as the type for a bitfield, whereas ARM64 returns i64 so goes down this (better, but wrong) codepath. llvm-svn: 208231
* PR19562: Fix another temporary node leak in Clang debug info emissionDavid Blaikie2014-05-071-10/+10
| | | | | | | | | | | | | | While constructing ObjC Interface types we might create the declaration of some normal C++ types, thus adding things to the ReplaceMap. Make sure we process the ReplaceMap after the ObjC interfaces. In theory we know at this point, since we're at the end of the TU, that we won't be upgrading any declarations to definitions, so we could just construct non-temporary nodes, but that would require extra state in CGDebugInfo to conditionalize the creation of declaration nodes which seems annoying/more work than is appropriate. llvm-svn: 208226
* [ARM64-BE] Correctly deal with single element HFAs in varargs.James Molloy2014-05-071-2/+4
| | | | | | | Just because the first "if" didn't fire, doesn't mean we can not have an HFA in the "else" clause. llvm-svn: 208216
* DebugInfo: Use enum instead of unsignedEd Maste2014-05-072-11/+13
| | | | | | | | This makes debuging DebugInfo generation with LLDB a little more pleasant. Differential Revision: http://reviews.llvm.org/D3626 llvm-svn: 208203
* ARM: Fix assertion caused by passing bitfield struct using ↵Oliver Stannard2014-05-071-1/+2
| | | | | | | | | | | | ABIArgInfo::getExpandWithPadding In cases where a struct must, according to the AAPCS, not be split between general purpose and floating point registers, we use ABIArgInfo::getExpandWithPadding to add the padding arguments. However, ExpandWithPadding does not work if the struct contains bitfields, so we instead must use ABIArgInfo::getDirect. llvm-svn: 208185
* [OPENMP] Fixed problem with temp removal on some platforms in codegen for ↵Alexey Bataev2014-05-072-10/+7
| | | | | | '#pragma omp parallel' llvm-svn: 208162
* PR19562: Fix memory leak when ObjC interface types cause the creation of ↵David Blaikie2014-05-071-1/+5
| | | | | | further interfaces. llvm-svn: 208161
* Include translation unit filename in global ctor symbol names.Nico Weber2014-05-061-3/+16
| | | | | | | | | | | | | | | | | This makes it easier to see where a global ctor comes from, and it also makes ASan's init order analyzer output easier to understand. gcc does this too, but only in -fPIC mode for some reason. Don't do this for constructors with explicit init priority. Also prepend "sub_" before the 'I', that way regular constructors stay lexicographically after symbols with init priority (because ord('s') > ord('I')). gold seems to ignore the name of constructor symbols, and ld only looks at the symbol if it includes an init priority, which this patch doesn't change. Before: __GLOBAL_I_a Now: __GLOBAL_sub_I_myfile.cc llvm-svn: 208128
* Reapply: DebugInfo: Emit the definition of enums when the definition ↵David Blaikie2014-05-063-0/+35
| | | | | | | | | | | | | | | | | | | preceeds the declaration and initial use. Reverting r208106 to reapply r208065 with a fix for the regression. The issue was that the enum tried to be built even if the declaration hadn't been constructed for debug info - presenting problems for enum templates and typedefs of enums with names for linkage purposes. Original commit message: This regressed a little further 208055 though it was already a little broken. While the requiresCompleteType optimization should be implemented here. Future (possibly near future) work. llvm-svn: 208114
* Revert "DebugInfo: Emit the definition of enums when the definition preceeds ↵David Blaikie2014-05-063-35/+0
| | | | | | | | | | | the declaration and initial use." This is breaking the compiler-rt build. Reverting while I investigate/fix. This reverts commit r208065. llvm-svn: 208106
* [OPENMP] Initial codegen for '#pragma omp parallel'Alexey Bataev2014-05-0610-5/+457
| | | | llvm-svn: 208077
* XCore target: fix initialization bug found by MSan Bot.Robert Lytton2014-05-061-0/+1
| | | | llvm-svn: 208072
* DebugInfo: Emit the definition of enums when the definition preceeds the ↵David Blaikie2014-05-063-0/+35
| | | | | | | | | | | | declaration and initial use. This regressed a little further 208055 though it was already a little broken. While the requiresCompleteType optimization should be implemented here. Future (possibly near future) work. llvm-svn: 208065
* PR19598: Ensure temporary metadata nodes used in debug info are destroyed.David Blaikie2014-05-062-40/+34
| | | | | | | | | | | | | | | | | | | CGDebugInfo and DIBuilder were lax in their handling of temporary MDNodes. All temporary nodes need to be deleted, which means they need to be RAUW'd with a permanent node. This was not happening. To ensure this, leverage DIBuilder's new ability to create both permanent and temporary declarations. Ensure all temporary declarations are RAUW'd, even with itself. (DIDescriptor::RAUW handles the case where it is replaced with itself and creates a new, duplicate permanent node to replace itself with) This means that all temporary declarations must be added to the ReplacementMap even if they're never upgraded to definitions - so move the point of insertion into the map to the point of creation of the declarations. llvm-svn: 208055
* Build debug info for ObjC interface types at the end of the translation unit ↵David Blaikie2014-05-052-107/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | to ensure all ivars are included. This takes a different approach than the completedType/requiresCompleteType work which relies on AST callbacks to upgrade the type declaration to a definition. Instead, just defer constructing the definition to the end of the translation unit. This works because the definition is never needed by other debug info (so far as I know), whereas the definition of a struct may be needed by other debug info before the end of the translation unit (such as emitting the definition of a member function which must refer to that member function's declaration). If we had a callback for whenever an IVar was added to an ObjC interface we could use that, and remove the need for the ObjCInterfaceCache, which might be nice. (also would need a callback for when it was more than just a declaration so we could get properties, etc). A side benefit is that we also don't need the CompletedTypeCache anymore. Just rely on the declaration-ness of a type to decide whether its definition is yet to be emitted. There's still the PR19562 memory leak, but this should hopefully make that a bit easier to approach. llvm-svn: 208015
* Simplify replacement map by avoiding duplicate values and ensuring the ↵David Blaikie2014-05-051-15/+9
| | | | | | | | | | | | | values it does contain are necessary. Items were being redundantly added to the replacement map (both when the declaration was created, and then again when its definition was constructed) which caused extra handling to be required when walking the map (as elements may've already been replaced due to prior entries). By avoiding adding the duplicates, the checks in the replacement handling can be replaced with assertions. llvm-svn: 208000
* MS ABI: Emit an error during IRgen on C++ exception handlingReid Kleckner2014-05-051-0/+10
| | | | | | | | | | | | | | | | Currently, users get error messages about RTTI descriptor mangling with no useful source location. This addresses that. Another approach would be to disable C++ exceptions by default in the driver when using the Microsoft C++ ABI. However, this makes it impossible to parse system headers that use exception handling constructs. By delaying the error to IRgen, we can figure out if we actually need to emit code for this construct. Additionally, users who are only interested in building refactoring tools on Windows still get a correct AST without having to add flags. Finally, this is consistent with what we do for SEH. llvm-svn: 207999
* Fix pr19653.Rafael Espindola2014-05-052-11/+25
| | | | | | Warn if an alias requests a section other than the aliasee section. llvm-svn: 207997
* Small refactoring, no functionality change.Rafael Espindola2014-05-051-3/+4
| | | | llvm-svn: 207991
* CodeGen: Assign linkage to thread-wrappers correctlyDavid Majnemer2014-05-051-2/+3
| | | | | | | | | | We would sometimes incorrectly give a thread-wrapper external linkage instead of internal linkage if we had only CodeGen'd it's declaration, not it's definition. This fixes PR19655. llvm-svn: 207988
* CodeGen: Cleanup visibility in RTTIBuilderDuncan P. N. Exon Smith2014-05-051-9/+5
| | | | | | No functionality change. llvm-svn: 207978
* CodeGen: complete ARM ACLE hint 8.4 supportSaleem Abdulrasool2014-05-041-5/+20
| | | | | | | Add support for the remaining hints from the ACLE. Although __dbg is listed as a hint, it is handled different, so it is not covered by this change. llvm-svn: 207930
* [leaks] Re-shuffle code such that we don't create a basic block forChandler Carruth2014-05-031-9/+11
| | | | | | | | | | initializing an array unless we need it. Specifically, position the creation of a new basic block after we've checked all of the cases that bypass the need for it. Fixes another leak in test/CodeGen* found by LSan. llvm-svn: 207900
* MS ABI x64: Pass small objects with dtors but no copy ctors directlyReid Kleckner2014-05-032-16/+38
| | | | | | | | | | | | | | | Passing objects directly (in registers or memory) creates a second copy of the object in the callee. The callee always destroys its copy, but we also have to destroy any temporary created in the caller. In other words, copy elision of these kinds of objects is impossible. Objects larger than 8 bytes with non-trivial dtors and trivial copy ctors are still passed indirectly, and we can still elide copies of them. Fixes PR19640. llvm-svn: 207889
* [leaks] Fix a leak of a basic block when we successfully fold a switchChandler Carruth2014-05-031-7/+10
| | | | | | | | | | | condition to a constant and emit only the relevant statement. In that case, we were previously creating the epilog jump destination, a cleanup scope, and emitting any condition variable into it. Instead, we can emit the condition variable (if we have one) into the cleanup scope used for the entire folded case sequence. We avoid creating a jump dest, a basic block, and an extra cleanup scope. Win! llvm-svn: 207888
* Small formatting change.Eric Christopher2014-05-021-1/+1
| | | | llvm-svn: 207852
* XCore target: fix bug in dereferencing null pointer.Robert Lytton2014-05-021-6/+7
| | | | | | Also add basic cpp ABI tests where they differ from C ABI output. llvm-svn: 207834
* XCore target: Add TypeString meta data to IR output.Robert Lytton2014-05-023-0/+551
| | | | | | | This includes the addition of the virtual function: TargetCodeGenInfo::EmitTargetMD() llvm-svn: 207832
* CodeGen: rename __builtin_arm_sevl to __sevlSaleem Abdulrasool2014-05-021-5/+5
| | | | | | | ACLE adds the __sevl() extension. Rename the hint from a custom name to the ACLE specified name. llvm-svn: 207829
* Remove unused variable that I missed in my rush to fix the botsReid Kleckner2014-05-021-1/+1
| | | | llvm-svn: 207820
OpenPOWER on IntegriCloud