summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
Commit message (Collapse)AuthorAgeFilesLines
...
* After much contemplation, I've decided that we probably shouldn't "unique"John McCall2011-03-311-11/+29
| | | | | | | | | | | | | __block object copy/dispose helpers for C++ objects with those for different variables with completely different semantics simply because they happen to both be no more aligned than a pointer. Found by inspection. Also, internalize most of the helper generation logic within CGBlocks.cpp, and refactor it to fit my peculiar aesthetic sense. llvm-svn: 128618
* We were emitting construction v-tables with internal linkage all the time.John McCall2011-03-271-0/+1
| | | | | | | | | | | | | | | Emit them instead with the linkage of the VTT. I'm actually really ambivalent about this; it's what GCC does, but outside of improving code size (if the linkage is coalescing), I'm not sure it's at all relevant. Construction vtables are naturally referenced only by the VTT, which is itself only referenced by complete-object constructors and destructors; giving the construction vtables possibly-external linkage is important if you have an optimization that drills through the VTT to a reference to a particular construction vtable which it cannot just emit itself. llvm-svn: 128374
* Update type cache when a type is completed.Devang Patel2011-03-231-4/+2
| | | | | | Radar 9168773 llvm-svn: 128150
* The Darwin kernel does not provide useful guard variable support.John McCall2011-03-181-0/+3
| | | | | | | | 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
* Fix three of the four places where I left breadcrumbs to avoid unnecessaryJohn McCall2011-03-091-4/+6
| | | | | | recomputation. llvm-svn: 127322
* Use the "undergoes default argument promotion" bit on parameters toJohn McCall2011-03-091-1/+2
| | | | | | | | | | 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
* DebugInfo can be enabled or disabled at function level (e.g. using an ↵Devang Patel2011-03-071-8/+1
| | | | | | attribute). However, at module level it is determined by command line option and the state of command line option does not change during compilation. Make this layering explicit and fix accidental cases where the code generator was checking whether module has debug info enabled instead of checking whether debug info is enabled for this function or not. llvm-svn: 127165
* Do not emit stop point for CXXDefaultArgExpr. It results in suboptimial user ↵Devang Patel2011-03-071-1/+9
| | | | | | | | | | | | | experience. 21 int main() { 22 A a; For example, here user would expect to stop at line 22, even if A's constructor leads to a call through CXXDefaultArgExpr. This fixes ostream-defined.exp regression from gdb testsuite. llvm-svn: 127164
* StringRefify.Benjamin Kramer2011-03-051-1/+1
| | | | llvm-svn: 127082
* Pretty up the emission of field l-values and use volatile and TBAA whenJohn McCall2011-02-261-0/+2
| | | | | | | loading references as part of that. Use 'char' TBAA when accessing (immediate!) fields of a may_alias struct; fixes PR9307. llvm-svn: 126540
* Emit the structure layout of the block literal parameter to a blockJohn McCall2011-02-221-2/+2
| | | | | | | | | | invocation function into the debug info. Rather than faking up a class, which is tricky because of the custom layout we do, we just emit a struct directly from the layout information we've already got. Also, don't emit an unnecessarily parameter alloca for this "variable". llvm-svn: 126255
* Reorganize the emission of local variables.John McCall2011-02-221-1/+4
| | | | llvm-svn: 126189
* Assorted cleanup:John McCall2011-02-151-3/+30
| | | | | | | | | - Have CGM precompute a number of commonly-used types - Have CGF copy that during initialization instead of recomputing them - Use TBAA info when initializing a parameter variable - Refactor the scalar ++/-- code llvm-svn: 125562
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-081-2/+38
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* Simplify thunks code.Anders Carlsson2011-02-061-2/+1
| | | | llvm-svn: 124983
* Pass a 'ForVTable' flag to GetAddrOfThunk and pass it along to ↵Anders Carlsson2011-02-051-1/+2
| | | | | | | | GetOrCreateLLVMFunction so that we won't assert when building a thunk for an implicit virtual member function that is not marked used. llvm-svn: 124967
* Re-land r124768, with a fix for PR9130.Anders Carlsson2011-02-051-2/+4
| | | | | | We now emit everything except unused implicit virtual member functions when building the vtable. llvm-svn: 124935
* More capturing of 'this': implicit member expressions. Getting thatJohn McCall2011-02-031-0/+2
| | | | | | | | | | | right for anonymous struct/union members led to me discovering some seemingly broken code in that area of Sema, which I fixed, partly by changing the representation of member pointer constants so that IndirectFieldDecls aren't expanded. This led to assorted cleanups with member pointers in CodeGen, and while I was doing that I saw some random other things to clean up. llvm-svn: 124785
* Revert 124768.Rafael Espindola2011-02-031-4/+2
| | | | | | | This reopens PR99114, but that one at least can be avoided with an #include. PR9130 cannot. llvm-svn: 124780
* Don't try to mark virtual members referenced for classes where the key functionAnders Carlsson2011-02-031-2/+4
| | | | | | | | | | | is not defined in the current translation unit. Doing so lead to compile errors such as PR9114. Instead, when CodeGen is building the vtable, don't try to emit a definition for functions that aren't marked used in the current translation unit. Fixes PR9114. llvm-svn: 124768
* Move GetLLVMVisibility to CodeGenModule.Anders Carlsson2011-01-291-0/+10
| | | | llvm-svn: 124550
* Change CodeGenModule::setTypeVisibility to take a TypeVisibilityKind enum ↵Anders Carlsson2011-01-291-1/+10
| | | | | | instead of an "IsForRTTI" flag. llvm-svn: 124546
* Get rid of an unneeded parameter from setGlobalVisibility.Anders Carlsson2011-01-291-2/+1
| | | | llvm-svn: 124541
* Add a new function, to be used by CGRTTI, CGVTables and CGVTT (which each ↵Anders Carlsson2011-01-291-0/+8
| | | | | | has their own copy of this code). llvm-svn: 124537
* Remove IsDefinition from CodeGenModule::setTypeVisibility; it is always true.Anders Carlsson2011-01-291-1/+1
| | | | llvm-svn: 124529
* Change CodeGenModule::getVTableLinkage to be a non-static member function.Anders Carlsson2011-01-241-2/+1
| | | | llvm-svn: 124095
* Add unnamed_addr in CreateRuntimeVariable.Rafael Espindola2011-01-181-1/+2
| | | | llvm-svn: 123773
* Move name mangling support from CodeGen to AST. In thePeter Collingbourne2011-01-131-4/+5
| | | | | | | | | | | | | | process, perform a number of refactorings: - Move MiscNameMangler member functions to MangleContext - Remove GlobalDecl dependency from MangleContext - Make MangleContext abstract and move Itanium/Microsoft functionality to their own classes/files - Implement ASTContext::createMangleContext and have CodeGen use it No (intended) functionality change. llvm-svn: 123386
* Simplify mem{cpy, move, set} creation with IRBuilder.Benjamin Kramer2010-12-301-11/+0
| | | | llvm-svn: 122634
* Simplify the logic for emitting guard variables for template staticJohn McCall2010-11-061-1/+2
| | | | | | | | | 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
* Better solution: calculate the visibility of functions and variablesJohn McCall2010-10-301-2/+3
| | | | | | | | | | independently of whether they're definitions, then teach IR generation to ignore non-explicit visibility when emitting declarations. Use this to make sure that RTTI, vtables, and VTTs get the right visibility. More of rdar://problem/8613093 llvm-svn: 117781
* Do the guarding of instantiated static data membersFariborz Jahanian2010-10-271-2/+8
| | | | | | | | on if its linkage is weak. Currently this is the case but may change in the future. (part of radar 8562966). llvm-svn: 117452
* Substantially revise how clang computes the visibility of a declaration toJohn McCall2010-10-221-4/+1
| | | | | | | | more closely parallel the computation of linkage. This gets us to a state much closer to what gcc emits, modulo bugs, which will undoubtedly arise in abundance. llvm-svn: 117147
* This patch implements Next's IRGen for -fconstant-string-class=class-name.Fariborz Jahanian2010-10-191-5/+6
| | | | | | PR6056, //rdar: //8564463 llvm-svn: 116819
* Experimental TBAA support.Dan Gohman2010-10-141-0/+7
| | | | | | | This enables metadata generation by default, however the TBAA pass in the optimizer is still disabled for now. llvm-svn: 116536
* Opportunistically use the C++ personality function in ObjC++John McCall2010-09-161-0/+4
| | | | | | translation units that don't catch ObjC types. rdar://problem/8434851 llvm-svn: 114070
* Teach IR generation to return 'this' from constructors and destructorsJohn McCall2010-08-311-4/+1
| | | | | | under the ARM ABI. llvm-svn: 112588
* Abstract out everything having to do with member pointers into the ABIJohn McCall2010-08-231-2/+0
| | | | | | | | | | | class; they should just be completely opaque throughout IR gen now, although I haven't really audited that. Fix a bug apparently inherited from gcc-4.2 where we failed to null-check member data pointers when performing derived-to-base or base-to-derived conversions on them. llvm-svn: 111789
* Go back to asking CodeGenTypes whether a type is zero-initializable.John McCall2010-08-221-14/+4
| | | | | | | | | Make CGT defer to the ABI on all member pointer types. This requires giving CGT a handle to the ABI. It's way easier to make that work if we avoid lazily creating the ABI. Make it so. llvm-svn: 111786
* Abstract out member-pointer creation. I'm really unhappy about the currentJohn McCall2010-08-221-4/+0
| | | | | | | | duplication between the constant and non-constant paths in all of this. Implement ARM ABI semantics for member pointer constants and conversion. llvm-svn: 111772
* Implement support for member pointers under the Microsoft C++ ABI in theCharles Davis2010-08-161-2/+2
| | | | | | | | AST library. This also adds infrastructure for supporting multiple C++ ABIs in the AST. llvm-svn: 111117
* Store inheritance paths after CastExprs instead of inside them.John McCall2010-08-071-1/+2
| | | | | | | | | | | | | | | This takes some trickery since CastExpr has subclasses (and indeed, is abstract). Also, smoosh the CastKind into the bitfield from Expr. Drops two words of storage from Expr in the common case of expressions which don't need inheritance paths. Avoids a separate allocation and another word of overhead in cases needing inheritance paths. Also has the advantage of not leaking memory, since destructors for AST nodes are never run. llvm-svn: 110507
* Emit standard-library RTTI with external linkage, not weak_odr.John McCall2010-08-041-0/+5
| | | | | | | | | | Apply hidden visibility to most RTTI; libstdc++ does not rely on exact pointer equality for the type info (just the type info names). Apply the same optimization to RTTI that we do to vtables. Fixes PR5962. llvm-svn: 110192
* Merge PCHWriterDecl.cpp's isRequiredDecl and ↵Argyrios Kyrtzidis2010-07-291-9/+0
| | | | | | | | | | | | | | | CodeGenModule::MayDeferGeneration into a new function, DeclIsRequiredFunctionOrFileScopedVar. This is essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes. Since this logic is shared by CodeGen and the PCH mechanism, move it to the ASTContext, thus CodeGenModule's GetLinkageForFunction/GetLinkageForVariable and the GVALinkage enum is moved out of CodeGen. This fixes current (and avoids future) codegen-from-PCH bugs. llvm-svn: 109784
* cave in to reality and make ABIInfo depend on CodeGenTypes.Chris Lattner2010-07-291-1/+1
| | | | | | This will simplify a bunch of code, coming up next. llvm-svn: 109722
* IRgen: Support user defined attributes on block runtime functions.Daniel Dunbar2010-07-161-0/+5
| | | | | | | | | | | | | | | | | | - This issue here is that /usr/include/Blocks.h wants to define some of the block runtime globals as weak, depending on the target. This doesn't work in Clang because we aren't using the AST decl for these globals. - The fix is a pretty gross hack which just watches all the decls for the specific blocks globals we need to know about; if we see one we use it, otherwise we use the hand coded type. In time, I would like to clean this up by changing IRgen to ask Sema/AST for the decl, which would then be lazily loaded from the builtin table if necessary. This could be used in a whole host of places in IRgen and would get rid of a lot of grotty hand coding of LLVM IR; however, we need some extra Sema support for this as well as support for builtin global variables. llvm-svn: 108482
* IRgen: Move blocks runtime interfaces to CodeGenModule.Daniel Dunbar2010-07-161-0/+20
| | | | llvm-svn: 108481
* When deferring the emission of declarations with initializers in C++, rememberJohn McCall2010-07-151-0/+6
| | | | | | | 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
* CodeGen/ObjC/NeXT: Fix Obj-C message send to match llvm-gcc when choosingDaniel Dunbar2010-07-141-2/+6
| | | | | | | | whether to use objc_msgSend_fpret; the choice is target dependent, not Obj-C ABI dependent. - <rdar://problem/8139758> arm objc _objc_msgSend_fpret bug llvm-svn: 108379
* Provide a hook for the benefit of clients using clang IR gen as a subroutine:John McCall2010-07-061-0/+2
| | | | | | | | | | | | emit metadata associating allocas and global values with a Decl*. This feature is controlled by an option that (intentionally) cannot be enabled on the command line. To use this feature, simply set CodeGenOptions.EmitDeclMetadata = true; and then interpret the completely underspecified metadata. :) llvm-svn: 107739
OpenPOWER on IntegriCloud