aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDecl.cpp
AgeCommit message (Collapse)Author
2009-05-19Pass the destination QualType to EmitStoreOfScalar. No functionality change.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72118 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-18Since we miscompile many cases when declaring a variable with a reference ↵Anders Carlsson
type, make them unsupported for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72034 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15Fixup debug information for the location information for __blockMike Stump
variables. For this to work, the backend needs to handle more complex forms for locations. A typical utterance would be: %forwarding = getelementptr %0* %use_by_ref, i32 0, i32 1 ; <i8**> [#uses=1] %0 = load i8** %forwarding ; <i8*> [#uses=1] %1 = bitcast i8* %0 to %0* ; <%0*> [#uses=1] %x = getelementptr %0* %1, i32 0, i32 4 ; <i32*> [#uses=1] %2 = bitcast i32* %x to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %2, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*)) Presently when selection finds something it doesn't understand, it just avoids generating any information, which is safe, just incomplete. Radar 6867696 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71824 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12push GlobalDecl through enough of the CodeGenModule interfacesChris Lattner
to allow us to support generation of deferred ctors/dtors. It looks like codegen isn't emitting a call to the dtor in member-functions.cpp:test2, but when it does, its body should get emitted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26When calling the cleanup function specified by __attribute__((cleanup)), ↵Anders Carlsson
make sure to bitcast the argument so it has the same type as the first argument of the cleanup function. Fixes <rdar://problem/6827047>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20PR3247: Handle a couple of cases where we weren't emitting VLA sizes (and Eli Friedman
subsequently crashed). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19PR3853: Add CodeGen support for __thread.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69545 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14Audit __private_extern__ handling.Daniel Dunbar
- Exposed quite a few Sema issues and a CodeGen crash. - See FIXMEs in test case, and in SemaDecl.cpp (PR3983). I'm skeptical that __private_extern__ should actually be a storage class value. I think that __private_extern__ basically amounts to extern A __attribute__((visibility("hidden"))) and would be better off handled (a) as that, or (b) with an extra bit in the VarDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13Update to use hasAttr() instead of getAttr().Daniel Dunbar
- No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10Make messages consistent.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68756 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10reject codegen of __thread variables as unimplemented, rdar://6775265Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08Add a destination type argument to EmitConstantExpr. This will be used for ↵Anders Carlsson
when the destination has a reference type. (No functionality change yet) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68593 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02Don't use static globals for params as it confuses the optimzer that their ↵Sanjiv Gupta
values are never being used in the function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68328 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02When compiling C++ code, always mangle the names of static block var decls.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68280 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30Code gen does not yet supports __asm__ on a variableFariborz Jahanian
declaration. Reject it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-22don't set the name of a call instruction to "call" in release-asserts Chris Lattner
build. This shaves another 3% off. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67460 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-22fix CreateTempAlloca to not set a name on the alloca for temporariesChris Lattner
in release-assert builds. For automatic variables, explicitly set a name with setName that does not make a temporary std::string. This speeds up -emit-llvm-only -disable-free on PR3810 by 4.6% git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67459 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-21Fixup codegen for nested block literals so that we generateMike Stump
copy_helpers and dispose_helpers as necessary for them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20Fix codegen for support for super inside block literal expressions.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07Mangle param names with .arg. only.Sanjiv Gupta
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07Remove some FIXMEs for block literals that should be close to working.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06Complete __Block_byref_id_object_copy cogegen for block literals.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06Finish off __Block_byref_id_object_dispose codegen for block literals.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06Remove extra arg.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66243 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06More codegen support for the copy/dispose helpers for block literals.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06Framework for codegen for copy/dispose helpers.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-05Don't mangle names of local variables.Daniel Dunbar
- For one thing, this adds unneeded overhead; for another, this routine can be used to emit unnamed decls which we shouldn't try to mangle. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66212 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-05prep work for copy/destroy helpers for block literals.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66159 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-05Avoid dispose calls when only doing gc.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-05Add codegen support for __block variables to call _Block_object_dispose as ↵Mike Stump
necessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Continuation of PR3687: fix more places to use the right type for Eli Friedman
booleans. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Comment fix: change a question to an answer.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Improved ABI compliance for __block variables. No testcases yet as weMike Stump
still give an unsupported error for them due to the fact this is a work in progress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66007 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28First cut CodeGen support for __block variables.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65688 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25Allow constant initializers to reference their defining decl.Daniel Dunbar
- PR3662. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65472 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25Fold GeneraticStaticBlockVarDecl into callers.Daniel Dunbar
- No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65470 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25Pull COdeGenFunction::CreateStaticBlockVarDecl (just for creating theDaniel Dunbar
global variable) out of GenerateStaticBlockVarDecl. - No intended functionality change. - Prep for some mild cleanups and PR3662. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-22Last part of PR3254: use the same alignment computation in Sema and Eli Friedman
CodeGen. I'm not sure whether this actually makes any visible difference, but it's better to be consistent anyway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20Fix spacing.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18Address Chris's comments regarding C++ name mangling.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17Change EmitConstantExpr to allow failure.Daniel Dunbar
IRgen no longer relies on isConstantInitializer, instead we just try to emit the constant. If that fails then in C we emit an error unsupported (this occurs when Sema accepted something that it doesn't know how to fold, and IRgen doesn't know how to emit) and in C++ we emit a guarded initializer. This ends up handling a few more cases, because IRgen was actually able to emit some of the constants Sema accepts but can't Evaluate(). For example, PR3398. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64780 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13Set constant bit on static block vars as well. Patch by Anders Johnson!qDaniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64502 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13IRgen support for attribute used.Daniel Dunbar
- PR3566 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13Add CodeGen support for the nodebug attribute.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64445 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13Add basic support for C++ name mangling according to the Itanium C++Douglas Gregor
ABI to the CodeGen library. Since C++ code-generation is so incomplete, we can't exercise much of this mangling code. However, a few smoke tests show that it's doing the same thing as GCC. When C++ codegen matures, we'll extend the ABI tester to verify name-mangling as well, and complete the implementation here. At this point, the major client of name mangling is in the uses of the new "overloadable" attribute in C, which allows overloading. Any "overloadable" function in C (or in an extern "C" block in C++) will be mangled the same way that the corresponding C++ function would be mangled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12Honor attribute section on static block var decls.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64411 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10Function parameters for PIC16 are like local variables. So use the keyword ↵Sanjiv Gupta
".auto." to mangle their names. The working of PIC16AsmPrinter relies on that keyword currently. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09Use the new cleanup infrastructure for VLAs. The next iteration of patches ↵Anders Carlsson
will remove the old Obj-C EH cleanup code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64161 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07Emit a cleanup block for the cleanup attributeAnders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64052 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07Fixup goto codegen in and around VLAs.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64014 91177308-0d34-0410-b5e6-96231b3b80d8