aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDecl.cpp
AgeCommit message (Collapse)Author
2009-06-30Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext. This commit touches a lot of files since call sites for these methods are everywhere. I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-26typoDevang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74305 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05As an optimization, we maintain a cache of generatedMike Stump
___Block_byref_id_object_dispose and ___Block_byref_id_object_copy functions so that we can simply reuse instead of creating a new one. Additionally, add an assert to ensure no one yet tries to align a __block variable beyond the alignment of a pointer as the codegen is incomplete. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72974 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-27Add IRGen support for local variables of reference type.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22Targets like PIC16 generate Static decls for automatic variables, emit the ↵Sanjiv Gupta
appropriate debug descriptor as well in that case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72261 91177308-0d34-0410-b5e6-96231b3b80d8
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