summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Ensure that static local variables in function templates inherit theJohn McCall2010-11-021-1/+5
| | | | | | visibility of their function. llvm-svn: 118065
* Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall2010-10-151-22/+21
| | | | | | ambiguous context. llvm-svn: 116567
* Re-enable EH cleanups to destroy __block variables, now that we have a moment toJohn McCall2010-10-061-2/+1
| | | | | | deal with the consequences. Fixes rdar://problem/8224178. llvm-svn: 115816
* 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-3/+3
| | | | | | Itanium guards and use a slightly different compiled-in API. llvm-svn: 113330
* Local static block variable referecned in itsFariborz Jahanian2010-09-071-3/+4
| | | | | | | | block-literal initializer expression causes IRgen to crash. This patch fixes by saving it in StaticLocalDecl map already used for such purposes. (radar 8390455). llvm-svn: 113307
* Truncate block variable of bool type to i1 when itsFariborz Jahanian2010-09-031-1/+1
| | | | | | | value is used. This matches with non-block variable use of bool type. (Fixes radar 8390062). llvm-svn: 113027
* A constant initializer never matches the type of the variable it'sJohn McCall2010-09-031-1/+1
| | | | | | | initializing; it at best matches the element type of the variable it's initializing. Fixes PR8073. llvm-svn: 112992
* Revert "Another i1 vs. i8 type mismatch issue. This time", it breaks some ↵Daniel Dunbar2010-09-031-1/+1
| | | | | | projects. llvm-svn: 112922
* Another i1 vs. i8 type mismatch issue. This timeFariborz Jahanian2010-09-021-1/+1
| | | | | | a 'bool' byref variable in memory. Fixes radar 8382559. llvm-svn: 112835
* De-memberify the VarDecl and FunctionDecl StorageClass enums.John McCall2010-08-261-7/+7
| | | | | | This lets us remove Sema.h's dependency on Expr.h and Decl.h. llvm-svn: 112156
* IRgen: Change Emit{Load,Store}OfScalar to take a required Alignment argument andDaniel Dunbar2010-08-211-3/+5
| | | | | | | | 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
* IRgen: Use Ty consistently in this function.Daniel Dunbar2010-08-211-5/+4
| | | | llvm-svn: 111705
* Further adjustments to -Wglobal-constructors; works for references and directJohn McCall2010-08-021-2/+2
| | | | | | initializations now. llvm-svn: 110063
* Turn off EH cleanups for __block variables; they caused some internal buildbotJohn McCall2010-07-221-1/+3
| | | | | | failures. There's a radar tracking this. llvm-svn: 109170
* Rename LazyCleanup -> Cleanup. No functionality change for these last threeJohn McCall2010-07-211-13/+13
| | | | | | commits. llvm-svn: 109000
* Switch some random local-decl cleanups over to using lazy cleanups. Turn onJohn McCall2010-07-211-52/+57
| | | | | | | the block-release unwind cleanup: we're never going to test it if we don't turn it on. llvm-svn: 108992
* When deferring the emission of declarations with initializers in C++, rememberJohn McCall2010-07-151-2/+2
| | | | | | | 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
* Teach IR generation how to lazily emit cleanups. This has a lot of advantages,John McCall2010-07-131-46/+56
| | | | | | | | | | | | | | | mostly in avoiding unnecessary work at compile time but also in producing more sensible block orderings. Move the destructor cleanups for local variables over to use lazy cleanups. Eventually all cleanups will do this; for now we have some awkward code duplication. Tell IR generation just to never produce landing pads in -fno-exceptions. This is a much more comprehensive solution to a problem which previously was half-solved by checks in most cleanup-generation spots. llvm-svn: 108270
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-54/+58
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove unnecessary ASTContext parameter fromDouglas Gregor2010-07-011-1/+1
| | | | | | CXXRecordDecl::getDestructor(); no functionality change. llvm-svn: 107394
* finally get around to doing a significant cleanup to irgen:Chris Lattner2010-06-271-7/+6
| | | | | | | | have CGF create and make accessible standard int32,int64 and intptr types. This fixes a ton of 80 column violations introduced by LLVMContextification and cleans up stuff a lot. llvm-svn: 106977
* Change EmitReferenceBindingToExpr to take a decl instead of a boolean.Anders Carlsson2010-06-261-1/+1
| | | | llvm-svn: 106949
* Switch over to the new caching version of getMangledName.Anders Carlsson2010-06-221-6/+4
| | | | llvm-svn: 106549
* Move CodeGenOptions.h *back* into Frontend. This should have been done when theChandler Carruth2010-06-151-1/+1
| | | | | | dependency edge was reversed such that CodeGen depends on Frontend. llvm-svn: 106065
* Added AccessSpecDecl node.Abramo Bagnara2010-06-051-0/+1
| | | | llvm-svn: 105525
* Convert DeclNodes to use TableGen.Alexis Hunt2010-05-301-1/+1
| | | | | | | | The macros required for DeclNodes use have changed to match the use of StmtNodes. The FooFirst enumerator constants have been named firstFoo to match usage elsewhere. llvm-svn: 105165
* This cast is no longer required.Dan Gohman2010-05-281-4/+0
| | | | llvm-svn: 104916
* Patch to fix a irgen crash accessing an initialized local staticFariborz Jahanian2010-05-261-2/+3
| | | | | | variable in a local function. Fixes pr7101. llvm-svn: 104743
* If a function definition has any sort of weak linkage, its static localJohn McCall2010-05-251-8/+8
| | | | | | | | | | | | variables should have that linkage. Otherwise, its static local variables should have internal linkage. To avoid computing this excessively, set a function's linkage before we emit code for it. Previously we were assigning weak linkage to the static variables of static inline functions in C++, with predictably terrible results. This fixes that and also gives better linkage than 'weak' when merging is required. llvm-svn: 104581
* Ensure that destructors are called for NRVO'd objects when theDouglas Gregor2010-05-171-3/+31
| | | | | | | function does not return. Thanks to Eli for pointing out this corner case. llvm-svn: 103941
* When applying the named return value optimization, we still need toDouglas Gregor2010-05-151-2/+5
| | | | | | | destroy the variable along the exceptional edge; it's only during normal execution that we avoid destroying this variable. llvm-svn: 103872
* Implement a simple form of the C++ named return value optimization forDouglas Gregor2010-05-151-22/+36
| | | | | | | | | return statements. We perform NRVO only when all of the return statements in the function return the same variable. Fixes some link failures in Boost.Interprocess (which is relying on NRVO), and probably improves performance for some C++ applications. llvm-svn: 103867
* Emit the globals, metadata, etc. associated with static variables even whenJohn McCall2010-05-041-5/+2
| | | | | | | | they're unreachable. This matters because (if they're POD, or if this is C) the scope containing the variable might be reachable even if the variable isn't. Fixes PR7044. llvm-svn: 103052
* Fixes a Code Gen. Crash when calling destructor on a __blockFariborz Jahanian2010-05-041-4/+9
| | | | | | | variabe. Blocks and their construction/destruction is wip though. llvm-svn: 102985
* Just bail out immediately when emitting an unreachable function-local staticJohn McCall2010-05-031-0/+3
| | | | | | variable. Surprisingly, this does seem to be the right way to solve this. llvm-svn: 102961
* Add the same 'ForVirtualBase' parameter to EmitCXXDestructorCall.Anders Carlsson2010-05-021-2/+4
| | | | llvm-svn: 102882
* I hate default statements. Fixes PR6874.Douglas Gregor2010-04-231-4/+38
| | | | llvm-svn: 102160
* Some renaming of methods, fixes typoFariborz Jahanian2010-04-191-1/+2
| | | | | | (related to PR6769). llvm-svn: 101794
* Local static variables must be available module-wiseFariborz Jahanian2010-04-181-0/+1
| | | | | | | as they are accessible in static methods in a class local to the same function. Fixes PR6769. llvm-svn: 101756
* Reapply patch for adding support for address spaces and added a isVolatile ↵Mon P Wang2010-04-041-4/+10
| | | | | | field to memcpy, memmove, and memset. llvm-svn: 100305
* Revert r100193 since it causes failures in objc in clangMon P Wang2010-04-021-10/+4
| | | | llvm-svn: 100200
* Reapply patch for adding support for address spaces and added a isVolatile ↵Mon P Wang2010-04-021-4/+10
| | | | | | field to memcpy, memmove, and memset. llvm-svn: 100193
* Revert Mon Ping's 99930 due to broken llvm-gcc buildbots.Bob Wilson2010-03-301-10/+4
| | | | llvm-svn: 99949
* Added support for address spaces and added a isVolatile field to memcpy, ↵Mon P Wang2010-03-301-4/+10
| | | | | | memmove, and memset llvm-svn: 99930
* Change CodeGenModule to rely on the Module's symbol table instead ofJohn McCall2010-03-191-5/+10
| | | | | | | | | | | | | shadowing it in the GlobalDeclMap. Eliminates the string-uniquing requirement for mangled names, which should help C++ codegen times a little. Forces us to do string lookups instead of pointer lookups, which might hurt codegen times a little across the board. We'll see how it plays out. Removing the string-uniquing requirement implicitly fixes any bugs like PR6635 which arose from the fact that we had multiple uniquing tables for different kinds of identifiers. llvm-svn: 99012
* Fix a rare corner case bug which exposed a serious block API generationFariborz Jahanian2010-03-121-62/+62
| | | | | | | | | | | when initialized variable is a byref block variable and is referenced recursively in the initializer (you guessed it, it is block implementation of fibonacci number). Fix, on the other hand is trvial, by generating the API for byref variable before API for its initializer. We will have this test added to our internal test suite as a clang-style test is not possible due to very convoluted IR sequence. Fixes radar 7745514. llvm-svn: 98393
* set alignment on static locals properly, patch by Arnaud de Grandmaison!Chris Lattner2010-03-101-0/+2
| | | | llvm-svn: 98204
* IRgen: Add CreateMemTemp, for creating an temporary memory object for a ↵Daniel Dunbar2010-02-091-2/+1
| | | | | | | | | | particular type, and flood fill. - CreateMemTemp sets the alignment on the alloca correctly, which fixes a great many places in IRgen where we were doing the wrong thing. - This fixes many many more places than the test case, but my feeling is we need to audit alignment systematically so I'm not inclined to try hard to test the individual fixes in this patch. If this bothers you, patches welcome! PR6240. llvm-svn: 95648
* Reapply r95393, without the change to CGExpr. I was wrong in assuming that theDaniel Dunbar2010-02-081-16/+10
| | | | | | element type always matched the converted LLVM type for ExprType. llvm-svn: 95596
OpenPOWER on IntegriCloud