summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Add support for complex compound assignments where the LHS is a scalar.Eli Friedman2013-06-123-43/+68
| | | | | | Fixes <rdar://problem/11224126> and PR12790. llvm-svn: 183821
* Make va_arg and argument passing to varargs functions work correctly withEli Friedman2013-06-121-14/+35
| | | | | | | | AVX vectors when AVX is turned on. Fixes <rdar://problem/10513611>. llvm-svn: 183813
* Revert r183721. It caused cleanups to be delayed too long in some cases.Richard Smith2013-06-115-298/+270
| | | | | | Testcase to follow. llvm-svn: 183776
* Silence GCC warning.Benjamin Kramer2013-06-111-0/+1
| | | | llvm-svn: 183742
* Rework IR emission for lifetime-extended temporaries. Instead of trying to walkRichard Smith2013-06-115-270/+297
| | | | | | | | | | | | | | | | | into the expression and dig out a single lifetime-extended entity and manually pull its cleanup outside the expression, instead keep a list of the cleanups which we'll need to emit when we get to the end of the full-expression. Also emit those cleanups early, as EH-only cleanups, to cover the case that the full-expression does not terminate normally. This allows IR generation to properly model temporary lifetime when multiple temporaries are extended by the same declaration. We have a pre-existing bug where an exception thrown from a temporary's destructor does not clean up lifetime-extended temporaries created in the same expression and extended to automatic storage duration; that is not fixed by this patch. llvm-svn: 183721
* Fix a very silly mistake in r183590.Eli Friedman2013-06-111-1/+0
| | | | llvm-svn: 183720
* Fix a FIXME in a testcase about packed structs and calls I left aroundEli Friedman2013-06-111-1/+10
| | | | | | | | | while fixing a related bug. The fix here was simpler than I thought it would be. Fixes <rdar://problem/10530444>. llvm-svn: 183718
* Make sure we don't emit invalid IR for StmtExprs with complex cleanups.Eli Friedman2013-06-104-18/+36
| | | | | | Fixes <rdar://problem/14074868>. llvm-svn: 183699
* [CodeGen] Make CGCleanup.h include what it now usesReid Kleckner2013-06-092-7/+4
| | | | | | | Also move CGCleanup.h to the top of CGCleanup.cpp to verify that CGCleanup.h really includes what it needs. llvm-svn: 183632
* [CodeGen] Move EHScopeStack to CGCleanup.h from CodeGenFunction.hReid Kleckner2013-06-092-454/+458
| | | | | | | | | | No functionality change. CGCleanup.cpp provides the implementation for EHScopeStack, so it seems more consistent to place the class definition in CGCleanup.h. This should also help solve a header ordering problem that I have. llvm-svn: 183631
* Fixed comment typo.Michael Gottesman2013-06-081-1/+1
| | | | llvm-svn: 183598
* Debug info: An if condition now creates a lexical scope of its own.Adrian Prantl2013-06-081-0/+10
| | | | | | | | | Two variables with the same name declared in two if conditions in the same scope are no longer coalesced into one. rdar://problem/14024005 llvm-svn: 183597
* Fix va_arg on x86-64 for a struct containing a single int128_t. PR16248Eli Friedman2013-06-071-4/+17
| | | | llvm-svn: 183590
* 80-column fixup after recent change to getOrCreateType.Eric Christopher2013-06-071-15/+20
| | | | llvm-svn: 183586
* Fix line endings.Eli Friedman2013-06-071-2/+2
| | | | llvm-svn: 183583
* address some comments on r183474:Adrian Prantl2013-06-071-6/+1
| | | | | | | | | | - factor the name construction part out from constructSetterName - rename constructSetterName to the more appropriate constructSetterSelector no functionality change intended. rdar://problem/14035789 llvm-svn: 183582
* documentation: remove confusing reference to properties.Adrian Prantl2013-06-071-3/+3
| | | | llvm-svn: 183475
* ObjC Debug Info: Emit the names of accessors whenever they diverge fromAdrian Prantl2013-06-071-4/+34
| | | | | | | | the default names, not just when the isImplicit flag is set. rdar://problem/14035789 llvm-svn: 183474
* Improve documentation.Adrian Prantl2013-06-071-6/+12
| | | | llvm-svn: 183473
* Diagnose malformed x86 inline asm using 'y' constraint.Tim Northover2013-06-073-5/+27
| | | | | | | | X86's 'y' inline assembly constraint represents an MMX register, this change prevents Clang from hitting an assertion when passed an incompatible type to deal with. llvm-svn: 183467
* PR14763: Debug info for non-trivial record parametersDavid Blaikie2013-06-051-16/+0
| | | | | | | | | | There seems to have been some erroneous code attempting to describe the ABI of parameters (non-trivial record parameters are passed by reference). This would break the type of the function (especially when it caused a mismatch between the type of a declaration & a definition) causing PR14763 and PR14645. llvm-svn: 183329
* [ms-cxxabi] Thread GlobalDecls through to CodeGenModule::getFunctionLinkage.Peter Collingbourne2013-06-054-18/+18
| | | | | | | | This is so that we can give destructor variants different linkage later. Differential Revision: http://llvm-reviews.chandlerc.com/D819 llvm-svn: 183324
* [ms-cxxabi] Fix vbptr offsets in memptrs when the vbptr is in an nvbaseReid Kleckner2013-06-051-6/+2
| | | | | | | | Also addresses a review comment from John from on r180985 by removing the "== -1" check, since it's now reusing the correct code which has the comment. llvm-svn: 183318
* PR16214: Debug Info: -flimit-debug-info doesn't omit definitions for types ↵David Blaikie2013-06-052-38/+26
| | | | | | | | | | | | | | | | | | | | used via typedefs In an effort to make -flimit-debug-info more consistent I over-shot the mark & made types used via typedefs never produce definitions in the debug info (even if the type was used in a way that would require a definition). The fix for this is to do exactly what I was hoping to do at some point - plumb the declaration/definition choice through the various layers of "CreateType" in CGDebugInfo. In this way we can produce declarations whenever they are sufficient & definitions otherwise - including when qualifiers are used, for example (discovered in PR14467). This may not be complete (there may be other types/situations where we need to propagate the "declaration/definition" choice) but it lays the basic foundation which we can enhance in future iterations. llvm-svn: 183296
* Implement SparcV9ABIInfo::EmitVAArg.Jakob Stoklund Olesen2013-06-051-2/+46
| | | | | | | | | | | | This could actually be implemented with the LLVM IR va_arg instruction, but it doesn't seem to offer any advantages over accessing the va_list pointer directly. Using the va_list pointer directly makes it possible to perform type coercion directly from the argument array, and the va_list updates are exposed to the optimizers. llvm-svn: 183292
* Fix CoerceIntOrPtrToIntOrPtr on big-endian targets.Jakob Stoklund Olesen2013-06-051-2/+23
| | | | | | | | | | | | | | | | Type coercion for argument passing is equivalent to storing the source type and loading the destination type from the same pointer. On big-endian targets, this means that the high bits of integers are preserved. This patch fixes the CoerceIntOrPtrToIntOrPtr() function on big-endian targets by inserting the required shift instructions to preserve the high bits instead of the low bits. This is used by SparcABIInfo when passing small structs in the high bits of registers. llvm-svn: 183291
* Heed ABIArgInfo::getInReg() for return values.Jakob Stoklund Olesen2013-06-051-1/+4
| | | | | | | | The 'inreg' attribute can also be applied to function return values in LLVM IR. The SPARC v9 backend is using the flag when returning structs containing 32-bit floats. llvm-svn: 183290
* Model temporary lifetime-extension explicitly in the AST. Use this model toRichard Smith2013-06-053-2/+74
| | | | | | | | | handle temporaries which have been lifetime-extended to static storage duration within constant expressions. This correctly handles nested lifetime extension (through reference members of aggregates in aggregate initializers) but non-constant-expression emission hasn't yet been updated to do the same. llvm-svn: 183283
* [ms-cxxabi] Factor out some loops into helpers for readabilityReid Kleckner2013-06-041-29/+33
| | | | | | | No functionality change, covered by the existing virtual base adjustment tests. llvm-svn: 183251
* Fix typo in comment. Found by -Wdocumentation.Benjamin Kramer2013-06-041-1/+1
| | | | llvm-svn: 183217
* Remove some unreachable (and wrong) code and replace it with an assertion.Richard Smith2013-06-041-13/+3
| | | | llvm-svn: 183206
* Adding support for MSVC #pragma detect_mismatch functionality by emitting a ↵Aaron Ballman2013-06-046-0/+38
| | | | | | FAILIFMISMATCH linker command into the object file. llvm-svn: 183178
* Fix handling of pointers-to-members and comma expressions whenRichard Smith2013-06-031-1/+10
| | | | | | lifetime-extending temporaries in reference bindings. llvm-svn: 183089
* PR12848: When emitting a local variable declared 'constexpr', always ↵Richard Smith2013-06-021-8/+15
| | | | | | initialize it with a store or a memcpy, not by emitting the initializer expression. This is not required for correctness, but more closely aligns with people's expectations, and is cheap (since we've already evaluated the initializer). llvm-svn: 183082
* Fix style bug introduced in r183033.Ed Schouten2013-05-311-2/+1
| | | | | | | I renamed the function at one point in time, but forgot to fix the layout of the arguments. llvm-svn: 183036
* Add support for optimized (non-generic) atomic libcalls.Ed Schouten2013-05-311-19/+106
| | | | | | | | | | | | | | | | | For integer types of sizes 1, 2, 4 and 8, libcompiler-rt (and libgcc) provide atomic functions that pass parameters by value and return results directly. libgcc and libcompiler-rt only provide optimized libcalls for __atomic_fetch_*, as generic libcalls on non-integer types would make little sense. This means that we can finally make __atomic_fetch_* work on architectures for which we don't provide these operations as builtins (e.g. ARM). This should fix the dreaded "cannot compile this atomic library call yet" error that would pop up once every while. llvm-svn: 183033
* Do not reuse the debug location of the return value's store if there is ↵Adrian Prantl2013-05-301-2/+4
| | | | | | | | autorelease code to be emitted between store and return instructions. This is analoguous to what we do for lexical scope cleanups. rdar://problem/13977888 llvm-svn: 182947
* fix formatting.Adrian Prantl2013-05-301-1/+1
| | | | llvm-svn: 182946
* [ms-cxxabi] Implement MSVC virtual base adjustmentReid Kleckner2013-05-295-43/+149
| | | | | | | | | | | | While we can't yet emit vbtables, this allows us to find virtual bases of objects constructed in other TUs. This make iostream hello world work, since basic_ostream virtually inherits from basic_ios. Differential Revision: http://llvm-reviews.chandlerc.com/D795 llvm-svn: 182870
* Fix bad indentation.Jakob Stoklund Olesen2013-05-291-4/+4
| | | | llvm-svn: 182821
* Build correct coercion types in SparcV9ABIInfo.Jakob Stoklund Olesen2013-05-281-3/+127
| | | | | | | | | | | | | | | | The coercion type serves two purposes: 1. Pad structs to a multiple of 64 bits, so they are passed 'left-aligned' in registers. 2. Expose aligned floating point elements as first-level elements, so the code generator knows to pass them in floating point registers. We also compute the InReg flag which indicates that the struct contains aligned 32-bit floats. This flag is used by the code generator to pick the right registers. llvm-svn: 182753
* Add a SparcV9ABIInfo class for handling the standard SPARC v9 ABI.Jakob Stoklund Olesen2013-05-271-0/+93
| | | | | | | | | | | | | | | | - All integer arguments smaller than 64 bits are extended. - Large structs are passed indirectly, not using 'byval'. - Structs up to 32 bytes in size are returned in registers. Some things are not implemented yet: - EmitVAArg can be implemented in terms of the va_arg instruction. - When structs are passed in registers, float members require special handling because they are passed in the floating point registers. - Structs are left-aligned when passed in registers. This may require padding. llvm-svn: 182745
* Fix linkage computation for derived types in inline functions.Rafael Espindola2013-05-251-0/+1
| | | | | | | | | | | | | | | | | John noticed that the fix for pr15930 (r181981) didn't handle indirect uses of local types. For example, a pointer to local struct, or a function that returns it. One way to implement this would be to recursively look for local types. This would look a lot like the linkage computation itself for types. To avoid code duplication and utilize the existing linkage cache, this patch just makes the computation of "type with no linkage but externally visible because it is from an inline function" part of the linkage computation itself. llvm-svn: 182711
* DebugInfo: Rename CreatePointerType to getOrCreateTypeDeclarationDavid Blaikie2013-05-242-10/+12
| | | | | | | | | | | | | | | | To make this more consistent with 'getOrCreateType' & clarify the distinction between the two. The only thing I couldn't quite communicate in the name is that getOrCreateTypeDeclaration may actually produce a full definition (in -fno-limit-debug-info) but the point is to call it whenever only a declaration is needed & the implementation can choose whether to provide a declaration or definition. (also, unfortunately, getOrCreateType can produce declarations too - we should sure this up by making it not do that - any caller that can tolerate a declaration should be calling getOrCreateTypeDeclaration instead) llvm-svn: 182674
* PR16091: Error when attempting to emit debug info for undeduced auto return ↵David Blaikie2013-05-241-2/+7
| | | | | | | | | | | | types Perhaps we should just suppress this, rather than erroring, but since we have the infrastructure for it I figured I'd use it - if this is determined to be not the right thing we should probably remove that infrastructure entirely. I guess it's lying around from the early days of implementing debug info support. llvm-svn: 182673
* [PATCH] Generate cold attribute for functions marked __atribute__((cold))Diego Novillo2013-05-241-2/+3
| | | | | | | | | | | | | This removes a FIXME in CodeGenModule::SetLLVMFunctionAttributesForDefinition. When a function is declared cold we can now generate the IR attribute in addition to marking the function to be optimized for size. I tried adding a separate CHECK in the existing test, but it was failing. I suppose CHECK matches one line exactly once? This would be a problem if the attributes are listed in a different order, though they seem to be sorted. llvm-svn: 182666
* Suffixing #pragma comment(lib) library names with .lib if necessary. This ↵Aaron Ballman2013-05-241-2/+13
| | | | | | matches MSVC behavior, as well as allows us to properly link libraries such as the ones provided by the MSDN examples. llvm-svn: 182647
* Fix assert on temporary std::initializer_list.Richard Smith2013-05-231-1/+2
| | | | llvm-svn: 182615
* Debug Info: Handle function/method types using the most specific typeDavid Blaikie2013-05-222-15/+15
| | | | llvm-svn: 182533
* Comment and cleanup.Adrian Prantl2013-05-221-5/+7
| | | | | | rdar://problem/13359718 llvm-svn: 182524
OpenPOWER on IntegriCloud