summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* CodeGen/CGDeclCXX.cpp: Twine-ize CreateGlobalInitOrDestructFunction().NAKAMURA Takumi2012-03-281-1/+1
| | | | llvm-svn: 153578
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-3/+3
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Emit the exact size for the invariant intrinsics.Nick Lewycky2012-02-211-4/+7
| | | | llvm-svn: 151010
* Don't emit optimization-specific intrinsic at -O0.Richard Smith2012-02-171-0/+4
| | | | llvm-svn: 150838
* The clang half of r150794: after the construction of a global or static constRichard Smith2012-02-171-1/+17
| | | | | | | | variable ends, if the variable has a trivial destructor and no mutable subobjects then emit an llvm.invariant.start call for it. globalopt knows to make the variable const when evaluating this. llvm-svn: 150798
* Whether an argument is required (in contrast with being anJohn McCall2012-02-171-6/+7
| | | | | | | | | | | | | | | | | | | | | optional argument passed through the variadic ellipsis) potentially affects how we need to lower it. Propagate this information down to the various getFunctionInfo(...) overloads on CodeGenTypes. Furthermore, rename those overloads to clarify their distinct purposes, and make sure we're calling the right one in the right place. This has a nice side-effect of making it easier to construct a function type, since the 'variadic' bit is no longer separable. This shouldn't really change anything for our existing platforms, with one minor exception --- we should now call variadic ObjC methods with the ... in the "right place" (see the test case), which I guess matters for anyone running GNUStep on MIPS. Mostly it's just a substantial clean-up. llvm-svn: 150788
* Deal with a horrible C++11 special case. If a non-literal type has a constexprRichard Smith2012-02-131-10/+17
| | | | | | | | | | | constructor, and that constructor is used to initialize an object of static storage duration such that all members and bases are initialized by constant expressions, constant initialization is performed. In this case, the object can still have a non-trivial destructor, and if it does, we must emit a dynamic initializer which performs no initialization and instead simply registers that destructor. llvm-svn: 150419
* simplify a bunch of code to use the well-known LLVM IR types computed by ↵Chris Lattner2012-02-071-12/+4
| | | | | | CodeGenModule. llvm-svn: 149943
* Use function pointers, rather than references, to pass DestroyersPeter Collingbourne2012-01-261-1/+1
| | | | | | | around, in the process cleaning up the various gcc/msvc compiler workarounds. llvm-svn: 149036
* Switch LValue so that it exposes alignment in CharUnits. (No functional ↵Eli Friedman2011-12-031-1/+1
| | | | | | change.) llvm-svn: 145753
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-1/+1
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* Track whether an AggValueSlot is potentially aliased, and do notJohn McCall2011-08-251-1/+2
| | | | | | | | | | emit call results into potentially aliased slots. This allows us to properly mark indirect return slots as noalias, at the cost of requiring an extra memcpy when assigning an aggregate call result into a l-value. It also brings us into compliance with the x86-64 ABI. llvm-svn: 138599
* Use stronger typing for the flags on AggValueSlot and requireJohn McCall2011-08-251-1/+2
| | | | | | | creators to tell us whether something needs GC barriers. No functionality change. llvm-svn: 138581
* Remove some unnecessary single element array temporaries.Jay Foad2011-07-291-2/+1
| | | | llvm-svn: 136461
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-2/+2
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-6/+6
| | | | llvm-svn: 135370
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-151-1/+1
| | | | llvm-svn: 135265
* Generalize the routine for destroying an object with staticJohn McCall2011-07-131-45/+51
| | | | | | | storage duration, then explicitly exempt ownership-qualified types from it. llvm-svn: 135028
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-3/+4
| | | | llvm-svn: 134831
* Emit guard variables for any weak global that has a run-timeDouglas Gregor2011-07-011-6/+5
| | | | | | | initializer. Previously, we only used guard variables for weak static data members. Fixes <rdar://problem/9692249>. llvm-svn: 134266
* Restore correct use of GC barriers.John McCall2011-06-161-17/+14
| | | | llvm-svn: 133144
* Automatic Reference Counting.John McCall2011-06-151-7/+20
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Eliminate temporary argument vectors.Benjamin Kramer2011-05-281-8/+2
| | | | llvm-svn: 132260
* Reset the emitted initializers.Axel Naumann2011-05-061-0/+2
| | | | | | This enables incremental codegen, where the initializer array can be removed from the module, such that only new initializers will be emitted and run. llvm-svn: 130986
* Template static data members can have weak_odr linkage, not justJohn McCall2011-04-121-2/+5
| | | | | | | | weak linkage. Also, fix a problem where global weak variables with non-trivial initializers were getting guard variables, or at least were checking for them and then crashing. llvm-svn: 129342
* __cxa_atexit does not throw.Anders Carlsson2011-03-201-0/+2
| | | | llvm-svn: 127977
* The Darwin kernel does not provide useful guard variable support.John McCall2011-03-181-0/+8
| | | | | | | | Issue this as an IR-gen error; it's not really worthwhile doing this "right", i.e. in Sema, because IR gen knows a lot of tricks beyond what the constant evaluator knows. llvm-svn: 127854
* Use the "undergoes default argument promotion" bit on parameters toJohn McCall2011-03-091-14/+15
| | | | | | | | | | simplify the logic of initializing function parameters so that we don't need both a variable declaration and a type in FunctionArgList. This also means that we need to propagate the CGFunctionInfo down in a lot of places rather than recalculating it from the FAL. There's more we can do to eliminate redundancy here, and I've left FIXMEs behind to do it. llvm-svn: 127314
* Revert "Add CC_Win64ThisCall and set it in the necessary places."Tilmann Scheller2011-03-021-7/+4
| | | | | | This reverts commit 126863. llvm-svn: 126886
* Add CC_Win64ThisCall and set it in the necessary places.Tilmann Scheller2011-03-021-4/+7
| | | | llvm-svn: 126863
* Get rid of the areExceptionsEnabled() getter from LangOptions.Anders Carlsson2011-02-281-1/+1
| | | | llvm-svn: 126598
* Add a LangOptions::areExceptionsEnabled and start using it.Anders Carlsson2011-02-201-1/+1
| | | | llvm-svn: 126062
* In -fapple-kext mode, global object construction code Fariborz Jahanian2011-02-151-5/+6
| | | | | | ends up in the text segment. // rdar://8825235. llvm-svn: 125585
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-081-4/+2
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* Save getObjCGCAttrKind and use it in two placesFariborz Jahanian2011-01-131-2/+3
| | | | | | | for efficiancy (still part of //rdar://8761767). Per John's comment. llvm-svn: 123401
* Generate write-barriers for global objcFariborz Jahanian2011-01-131-1/+9
| | | | | | assigns. // rdar://8761767 llvm-svn: 123391
* Simplify the logic for emitting guard variables for template staticJohn McCall2010-11-061-20/+15
| | | | | | | | | data members by delaying the emission of the initializer until after linkage and visibility have been set on the global. Also, don't emit a guard unless the variable actually ends up with vague linkage, and don't use thread-safe statics in any case. llvm-svn: 118336
* Do the guarding of instantiated static data membersFariborz Jahanian2010-10-271-4/+9
| | | | | | | | on if its linkage is weak. Currently this is the case but may change in the future. (part of radar 8562966). llvm-svn: 117452
* Patch to provide guard when initializing instancesFariborz Jahanian2010-10-261-1/+9
| | | | | | | of static data member of a class template. Fixes //rdar :// 8562966 and pr8409. llvm-svn: 117410
* one piece of code is responsible for the lifetime of every aggregateJohn McCall2010-09-151-1/+1
| | | | | | | | | | | | | slot. The easiest way to do that was to bundle up the information we care about for aggregate slots into a new structure which demands that its creators at least consider the question. I could probably be convinced that the ObjC 'needs GC' bit should be rolled into this structure. Implement generalized copy elision. The main obstacle here is that IR-generation must be much more careful about making sure that exactly llvm-svn: 113962
* Implement ARM static local initialization guards, which are more compact thanJohn McCall2010-09-081-137/+7
| | | | | | Itanium guards and use a slightly different compiled-in API. llvm-svn: 113330
* Teach IR generation to return 'this' from constructors and destructorsJohn McCall2010-08-311-1/+2
| | | | | | under the ARM ABI. llvm-svn: 112588
* IRgen: Change Emit{Load,Store}OfScalar to take a required Alignment argument andDaniel Dunbar2010-08-211-4/+6
| | | | | | | | update callers as best I can. - This is a work in progress, our alignment handling is very horrible / sketchy -- I am just aiming for monotonic improvement. - Serious review appreciated. llvm-svn: 111707
* When initializing a static local, pop the guard-abort EH cleanup afterJohn McCall2010-08-101-0/+4
| | | | | | the variable is fully initialized. llvm-svn: 110704
* Emit global destructors even if the destroyed object has no initializers or hasJohn McCall2010-07-301-7/+3
| | | | | | | | an initializer requiring temporary object disposal. Fixes rdar:://problem/8246444. llvm-svn: 109849
* Rename LazyCleanup -> Cleanup. No functionality change for these last threeJohn McCall2010-07-211-2/+2
| | | | | | commits. llvm-svn: 109000
* Switch the __cxa_guard_abort cleanup to being a lazy cleanup.John McCall2010-07-211-5/+17
| | | | llvm-svn: 108993
* When deferring the emission of declarations with initializers in C++, rememberJohn McCall2010-07-151-5/+18
| | | | | | | the order they appeared in the translation unit. If they get emitted, put them in their proper order. Fixes rdar://problem/7458115 llvm-svn: 108477
* When creating functions to run global initializers and destructors, mark themJohn McCall2010-07-061-0/+3
| | | | | | as nounwind in -fno-exceptions. Fixes rdar://problem/8090834. llvm-svn: 107639
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-58/+4
| | | | | | | | | | | | | | | | | | | | | | | | self-host. Hopefully these results hold up on different platforms. I tried to keep the GNU ObjC runtime happy, but it's hard for me to test. Reimplement how clang generates IR for exceptions. Instead of creating new invoke destinations which sequentially chain to the previous destination, push a more semantic representation of *why* we need the cleanup/catch/filter behavior, then collect that information into a single landing pad upon request. Also reorganizes how normal cleanups (i.e. cleanups triggered by non-exceptional control flow) are generated, since it's actually fairly closely tied in with the former. Remove the need to track which cleanup scope a block is associated with. Document a lot of previously poorly-understood (by me, at least) behavior. The new framework implements the Horrible Hack (tm), which requires every landing pad to have a catch-all so that inlining will work. Clang no longer requires the Horrible Hack just to make exceptions flow correctly within a function, however. The HH is an unfortunate requirement of LLVM's EH IR. llvm-svn: 107631
OpenPOWER on IntegriCloud