summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Win64: Use ConvertType instead of checking the MS inheritanceReid Kleckner2014-05-021-12/+5
| | | | | | | | dependent-type-member-pointer.cpp is failing on a win64 bot because -fms-extensions is not enabled. Use ConvertType rather than relying on the inheritance attributes. It's less code, but probably slower. llvm-svn: 207819
* Win64: Pass member pointers larger than 8 bytes by referenceReid Kleckner2014-05-021-6/+23
| | | | | | | | | | | | | The Win64 ABI docs on MSDN say that arguments bigger than 8 bytes are passed by reference. Prior to this change, we were only applying this logic to RecordType arguments. This affects both the Itanium and Microsoft C++ ABIs. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D3587 llvm-svn: 207817
* MS ABI: Fix logic bug in member pointer null test codeReid Kleckner2014-05-021-1/+1
| | | | | | | | | This code is trying to test if the pointer is *not* null. Therefore we should use 'or' instead of 'and' to combine the results of 'icmp ne'. This logic is consistent with the general member pointer comparison code in EmitMemberPointerComparison. llvm-svn: 207815
* PR19623: Support typedefs (and alias templates) of void.David Blaikie2014-05-011-3/+0
| | | | llvm-svn: 207781
* AST: Mangle reference temporaries reliablyDavid Majnemer2014-05-011-1/+2
| | | | | | | | | | | | | | | Summary: Previously, we would generate a single name for all reference temporaries and allow LLVM to rename them for us. Instead, number the reference temporaries as we build them in Sema. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3554 llvm-svn: 207776
* MS ABI x64: Don't destroy arguments twice on x64Reid Kleckner2014-05-011-4/+11
| | | | | | | | We were destroying them in the callee, and then again in the caller. We should use an EH-only cleanup and disable it at the point of the call for win64, even though we don't use inalloca. llvm-svn: 207733
* [ARM64] Add arm64_be where it was accidentally missed from a bunch of ↵James Molloy2014-04-301-0/+1
| | | | | | | | | if-conditions. I think this is the last commit for ARM64 big endian in clang. This commit makes arm_neon.h compile correctly. llvm-svn: 207624
* Drop non-cfi assembly support from clang.Rafael Espindola2014-04-301-2/+0
| | | | | | | | | | | | | | After this patch clang will ignore -fdwarf2-cfi-asm and -ffno-dwarf2-cfi-asm and always print assembly that uses cfi directives. In llvm, MC itself supports cfi since the end of 2010 (support started in r119972, is reported in the 2.9 release notes). In binutils the support has been around for much longer. It looks like support started to be added in May 2003. It is available in 2.15 (31-Aug-2011, 2.14 is from 12-Jun-2003). llvm-svn: 207602
* CodeGen: Reference temporaries inherit visibilityDavid Majnemer2014-04-291-0/+3
| | | | | | | Reference temporaries inherited many properties from the variable that they correspond to but visibility wasn't one of them. llvm-svn: 207496
* Debug info: Improve line table for functions with cleanups an early exitAdrian Prantl2014-04-291-0/+20
| | | | | | | | | | | | | and no return expr at the end of the function. The "function has only simple returns" check in FinishFunction tests whether the number of simple return exprs equals the number of return exprs, but so far a fallthrough at the end of a function was not counted as a return, which would result in cleanup code being associated with the wrong source line. rdar://problem/16733984. llvm-svn: 207480
* CodeGen: Fix linkage of reference temporariesDavid Majnemer2014-04-284-102/+110
| | | | | | | | | | | | | | | Summary: A reference temporary should inherit the linkage of the variable it initializes. Otherwise, we may hit cases where a reference temporary wouldn't have the same value in all translation units. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3515 llvm-svn: 207451
* [ARM64]Fix a bug cannot select UQSHL/SQSHL with constant i64 shift amount.Hao Liu2014-04-281-10/+6
| | | | llvm-svn: 207401
* CodeGen: remove an unused variableSaleem Abdulrasool2014-04-281-3/+0
| | | | llvm-svn: 207390
* remove useless codeSylvestre Ledru2014-04-271-1/+0
| | | | llvm-svn: 207360
* Fixed Assert In CGRecordLoweringWarren Hunt2014-04-251-6/+23
| | | | | | | | | | | Prior to this patch, CGRecordLower assumed that virtual bases could not be placed before the nvsize of an object. This isn't true in Itanium mode, virtual bases are placed at dsize rather than vnsize and in the case of zero sized non-virtual bases nvsize can be larger than dsize. This patch fixes CGRecordLowering to avoid an assert and to clip bitfields properly in this case. A test case is included. llvm-svn: 207280
* CodeGen: add __yield intrinsic for ARMSaleem Abdulrasool2014-04-251-0/+5
| | | | | | | | | The __yield intrinsic generates a hint instruction to indicate that the thread is not performing any useful operations at the moment. This is for compatibility with MSVC, although, the intrinsic is also part of the ACLE, and is enabled globally as a result. llvm-svn: 207275
* CodeGen: replace use of @llvm.arm.sevl with @llvm.arm.hintSaleem Abdulrasool2014-04-251-2/+2
| | | | | | | Use the new generic @llvm.arm.hint hint intrinsic rather than the specialised @llvm.arm.sevl hint instruction. llvm-svn: 207243
* CodeGen: Cleanup variable linkage calculationDavid Majnemer2014-04-251-9/+18
| | | | | | | | | | Almost all linkage calculation for VarDecls occured inside of GetLLVMLinkageVarDefinition except for static data members. Centralize the logic so that it can be more readily reused. No functionality change. llvm-svn: 207241
* CodeGen: Refactor linkage/visibility calculationDavid Majnemer2014-04-251-33/+27
| | | | | | | | | | It turns out that linkage and visibility have rather similar logic for both functions and non-variable globals. Split the calculation out so that both sides may share this code. No functionality change. llvm-svn: 207239
* CodeGen: Avoid instrumenting implicit Decls more effectivelyJustin Bogner2014-04-251-2/+4
| | | | | | | | | | We don't assign counters for implicit Decls, but we were emitting code to increment the (non-existent) counters and adding empty counter lists in the output. This fixes the checks in assignRegionCounters and emitInstrumentationData to do the right thing, and adds an assert for the pathological case of emitting zero counters. llvm-svn: 207203
* MS ABI: Use a different guard variable for each weak globalReid Kleckner2014-04-231-11/+16
| | | | | | | | | | We were using the same guard variable and failing to initialize the second global. Clang is still not MS ABI compatible in this area. Fixing that is PR16959, which will require LLVM changes to @llvm.global_ctors. llvm-svn: 207008
* Objective-C [IRGen]. Fixes a crash in IRGen involving use ofFariborz Jahanian2014-04-231-1/+4
| | | | | | | 'typeof' to extract type of an @encode expression used in an initializer. // rdar://16655340 llvm-svn: 207004
* [ARM64] Add a missed case label for arm64_be, and enable the aarch64-varargs ↵James Molloy2014-04-231-1/+2
| | | | | | | | test for arm64_be. This ensures that r203917 (cpirker "AArch64_be varargs processing for ARM ABI") is ported to ARM64. llvm-svn: 206961
* CodeGen: Unify handling guard variables in the Itanium C++ ABIJustin Bogner2014-04-231-41/+39
| | | | | | | | | | | | | | | We previously treated ARM separately from the generic Itanium ABI for initializing guard variables. This code duplication led to things like the ARM path missing the memory barrier for threadsafe handling, and a highly misleading comment about how we were (mis)using the generic ABI for ARM64 when really it went through the ARM codepath. This unifies the two code paths. Functionally, this changes the ARM and ARM64 codepath to use one byte loads instead of 4 and 8, respectively, and adds the missing atomic acquire to these loads. Other architectures are unchanged. llvm-svn: 206937
* Use a manipulator to add a value to the current diagnostic flag.Diego Novillo2014-04-221-3/+2
| | | | | | | | | | | | | | Summary: This addresses the feedback to http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140421/103598.html Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3453 llvm-svn: 206920
* Allow adding a value to a flag in diagnostics.Diego Novillo2014-04-211-1/+2
| | | | | | | | | | | | | | | | | Summary: This allows callers of Diags.Report() to append a value to the name of the flag associated with the diagnostic. This is useful in cases like the -Rpass flag, where we want the diagnostic to show the name of the pass that matched the pattern. Instead of showing "... [-Rpass]", this allows us to show "... [-Rpass=passname]". Reviewers: rsmith CC: cfe-commits Differential Revision: http://reviews.llvm.org/D3441 llvm-svn: 206826
* [Modules] Remove the only use of the DEBUG(...) macro in the compilerChandler Carruth2014-04-211-1/+0
| | | | | | | | parts of Clang. I don't really have any opinion about whether using that macro is good or bad, but its odd that this is the only one, and Eric seemed happy with just nuking it for now. llvm-svn: 206806
* ARM64: Do not expand variadic HFA/HVA arguments with the Darwin ABI.Bob Wilson2014-04-211-6/+24
| | | | | | | | | | | Unlike the standard AAPCS64 ABI, variadic arguments are always passed on the stack with the Darwin ABI, and this was not being considered when deciding whether to expand HFA/HVA arguments in a call. An HFA argument with a "float" base type was being expanded into separate "float" arguments, each of which was then extended to a double, resulting in a serious mismatch from what is expected by the va_arg implementation. <rdar://problem/15777067> llvm-svn: 206729
* Fix a comment typo.Bob Wilson2014-04-211-1/+1
| | | | llvm-svn: 206728
* Remove some empty statementsAlp Toker2014-04-192-2/+2
| | | | | | Cleanup only. llvm-svn: 206709
* When a module completes the definition of a class template specialization ↵Richard Smith2014-04-192-3/+5
| | | | | | imported from another module, emit an update record, rather than using the broken decl rewriting mechanism. If multiple modules do this, merge the definitions together, much as we would if they were separate declarations. llvm-svn: 206680
* CodeGen: Remove an unused includeJustin Bogner2014-04-181-1/+0
| | | | llvm-svn: 206667
* CodeGen: Use LLVM's InstrProfReader in -fprofile-instr-use=Justin Bogner2014-04-185-177/+31
| | | | | | | | | Update clang to use the InstrProfReader from LLVM to read instrumentation based profile data. This also switches us from the naive text format to the binary format, since that's what's implemented in the reader. llvm-svn: 206658
* [Cleanup] Remove a trailing whitespaceJustin Bogner2014-04-181-1/+1
| | | | llvm-svn: 206657
* ARM64: make sure the caller is expected to extend in AAPCS.Tim Northover2014-04-181-2/+3
| | | | | | | This is one of those DarwinPCS differences. It'd been caught in arguments, but not return values. llvm-svn: 206594
* ARM64: make sure HFAs on the stack get properly aligned.Tim Northover2014-04-181-7/+8
| | | | | | Another AAPCS bug, part of PR19432. llvm-svn: 206580
* BackendUtil: Pass through -mdisable-tail-callsDuncan P. N. Exon Smith2014-04-181-0/+1
| | | | | | | | | | | | | | | The frontend option -fno-optimize-sibling-calls resolves to -cc1's -mdisable-tail-calls, which is passed to the TargetMachine in the backend. PassManagerBuilder was adding the -tailcallelim pass anyway. Use a new DisableTailCalls option in PassManagerBuilder to disable tail calls harder. Requires the matching commit in LLVM that adds DisableTailCalls. <rdar://problem/16050591> llvm-svn: 206543
OpenPOWER on IntegriCloud