summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add unnamed_addr in CreateRuntimeVariable.Rafael Espindola2011-01-181-2/+7
| | | | llvm-svn: 123773
* Replace calls to CharUnits::fromQuantity() with ones to Ken Dyck2011-01-181-2/+2
| | | | | | ASTContext::toCharUnitsFromBits() when converting from bit sizes to char units. llvm-svn: 123720
* More unnamed_addr.Rafael Espindola2011-01-171-0/+1
| | | | llvm-svn: 123681
* merge strings created byRafael Espindola2011-01-171-0/+1
| | | | | | const NSConstantString *appKey = @"MyApp"; llvm-svn: 123680
* Add unnamed_addr to the special strings created byRafael Espindola2011-01-171-0/+1
| | | | | | | __builtin___CFStringMakeConstantString This fixes PR8993. A darwin expert might want to check that this is safe. llvm-svn: 123658
* Move name mangling support from CodeGen to AST. In thePeter Collingbourne2011-01-131-6/+14
| | | | | | | | | | | | | | 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
* Set unnamed_addr for type infos that we are confortable marking as hidden. IRafael Espindola2011-01-111-0/+1
| | | | | | think it is safe to mark all type infos with unnamed_addr, but I am not sure. llvm-svn: 123275
* Add unnamed_addr to constructors and destructors.Rafael Espindola2011-01-111-0/+3
| | | | llvm-svn: 123197
* Add unnamed_addr when creating artificial string globals. For example, inRafael Espindola2011-01-101-3/+6
| | | | | | | | | static const char foo[] = "foo"; static const char *bar = "bar"; the global created to hold "bar" will have it, but foo will not. llvm-svn: 123192
* Simplify mem{cpy, move, set} creation with IRBuilder.Benjamin Kramer2010-12-301-21/+0
| | | | llvm-svn: 122634
* Set the "implicitly inline" bit on a method as soon as we see a definitionJohn McCall2010-12-151-23/+24
| | | | | | | | within the class. Teach IR gen to look for function definitions in record lexical contexts when deciding whether to emit a function whose address was taken. Fixes PR8789. llvm-svn: 121833
* Add support for the common and nocommon attributes.Eric Christopher2010-12-021-1/+3
| | | | | | rdar://8560647 llvm-svn: 120650
* Simplify the logic for emitting guard variables for template staticJohn McCall2010-11-061-1/+4
| | | | | | | | | 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
* Ensure that static local variables in function templates inherit theJohn McCall2010-11-021-0/+7
| | | | | | visibility of their function. llvm-svn: 118065
* Better solution: calculate the visibility of functions and variablesJohn McCall2010-10-301-10/+23
| | | | | | | | | | 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
* Restore r117644, this time properly ignoring -fvisibility and type visibilityJohn McCall2010-10-291-17/+23
| | | | | | | | | | | | | | | for namespace-scope variable declarations. Apply visibility in IR gen to variables that are merely declared and never defined. We were previously emitting these with default visibility unless they were declared with private_extern. Ignore global visibility settings when computing visibility for a declaration's context, and key several conditions on whether a visibility attribute exists anywhere in the hierarchy as opposed to whether it exists at the current level. llvm-svn: 117729
* Revert r117644, "Apply visibility in IR gen to variables that are merelyDaniel Dunbar2010-10-291-23/+17
| | | | | | declared", it breaks things. llvm-svn: 117653
* Apply visibility in IR gen to variables that are merely declaredJohn McCall2010-10-291-17/+23
| | | | | | | | | | | | and never defined. We were previously emitting these with default visibility unless they were declared with private_extern. Ignore global visibility settings when computing visibility for a declaration's context, and key several conditions on whether a visibility attribute exists anywhere in the hierarchy as opposed to whether it exists at the current level. llvm-svn: 117644
* Do the guarding of instantiated static data membersFariborz Jahanian2010-10-271-19/+28
| | | | | | | | 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-65/+10
| | | | | | | | 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-10/+21
| | | | | | PR6056, //rdar: //8564463 llvm-svn: 116819
* Experimental TBAA support for enum types.Dan Gohman2010-10-151-1/+2
| | | | llvm-svn: 116613
* Don't leak the TBAA object.Dan Gohman2010-10-151-0/+1
| | | | llvm-svn: 116595
* Experimental TBAA support.Dan Gohman2010-10-141-0/+17
| | | | | | | This enables metadata generation by default, however the TBAA pass in the optimizer is still disabled for now. llvm-svn: 116536
* lib/CodeGen/CodeGenModule.cpp: DLLImportLinkage should be processed also on ↵NAKAMURA Takumi2010-10-111-1/+3
| | | | | | | | declaration. It enables clang to compile Mingw's headers. llvm-svn: 116184
* Add support for attribute((naked)), patch by Zoxc on cfe-commits!Daniel Dunbar2010-09-291-0/+3
| | | | | | - Minor style tweaks by me. llvm-svn: 115056
* Kill FunctionDecl's IsCopyAssignment bit; it duplicated what couldDouglas Gregor2010-09-271-1/+1
| | | | | | | | already be determined by isCopyAssignmentOperator(), and was set too late in the process for all clients to see the appropriate value. Cleanup only; no functionality change. llvm-svn: 114916
* Opportunistically use the C++ personality function in ObjC++John McCall2010-09-161-0/+2
| | | | | | translation units that don't catch ObjC types. rdar://problem/8434851 llvm-svn: 114070
* get rid of a warning.Fariborz Jahanian2010-09-071-3/+3
| | | | llvm-svn: 113256
* Have Sema check for validity of CGString literalFariborz Jahanian2010-09-071-9/+0
| | | | | | instead of asserting in IRGen. Fixes radar 8390459. llvm-svn: 113253
* Teach IR generation to return 'this' from constructors and destructorsJohn McCall2010-08-311-7/+8
| | | | | | under the ARM ABI. llvm-svn: 112588
* De-memberify the VarDecl and FunctionDecl StorageClass enums.John McCall2010-08-261-2/+2
| | | | | | This lets us remove Sema.h's dependency on Expr.h and Decl.h. llvm-svn: 112156
* Support for IRGen of synthesize bitfield ivars inFariborz Jahanian2010-08-231-1/+10
| | | | | | objc-nonfragile-abi2 (radar 7824380). llvm-svn: 111823
* Go back to asking CodeGenTypes whether a type is zero-initializable.John McCall2010-08-221-21/+15
| | | | | | | | | 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
* The ARM C++ ABI is sufficiently different from the Itanium C++ ABI thatJohn McCall2010-08-211-1/+5
| | | | | | | it deserves its own enumerator. Obviously the implementations should closely follow the Itanium ABI except in cases of divergence. llvm-svn: 111749
* Add some enum goodness as requested by Chris. Now instead of storing theCharles Davis2010-08-191-3/+6
| | | | | | | | | | active C++ ABI as a raw string, we store it as an enum. This should improve performance somewhat. And yes, this time, I started from a clean build directory, and all the tests passed. :) llvm-svn: 111507
* Generate Attr subclasses with TableGen.Alexis Hunt2010-08-181-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | Now all classes derived from Attr are generated from TableGen. Additionally, Attr* is no longer its own linked list; SmallVectors or Attr* are used. The accompanying LLVM commit contains the updates to TableGen necessary for this. Some other notes about newly-generated attribute classes: - The constructor arguments are a SourceLocation and a Context&, followed by the attributes arguments in the order that they were defined in Attr.td - Every argument in Attr.td has an appropriate accessor named getFoo, and there are sometimes a few extra ones (such as to get the length of a variadic argument). Additionally, specific_attr_iterator has been introduced, which will iterate over an AttrVec, but only over attributes of a certain type. It can be accessed through either Decl::specific_attr_begin/end or the global functions of the same name. llvm-svn: 111455
* Convert all uses of StringLiteral::getStrData() to StringLiteral::getString()Benjamin Kramer2010-08-171-10/+6
| | | | | | and remove getStrData(). Patch by Peter Davies (with some tweaks). llvm-svn: 111229
* Just disable the hidden-visibility optimization for now by hiding it behindJohn McCall2010-08-121-1/+4
| | | | | | | | a -cc1 option. The Darwin linker complains about mixed visibility when linking gcc-built objects with clang-built objects, and the optimization isn't really that valuable. Platforms with less ornery linkers can feel free to enable this. llvm-svn: 110979
* Thread local variables aren't considered common linkage.Eric Christopher2010-08-081-1/+2
| | | | llvm-svn: 110530
* It turns out that linkers (at least, the Darwin linker) don't necessarilyJohn McCall2010-08-051-6/+13
| | | | | | | | | | | do the right thing with mixed-visibility symbols, so disable the visibility optimization where that's possible, i.e. with template classes (since it's possible that an arbitrary template might be subject to an explicit instantiation elsewhere). 447.dealII actually does this. I've put the code under an option that's currently not hooked up to anything. llvm-svn: 110374
* Implement #pragma GCC visibility.Eli Friedman2010-08-051-2/+4
| | | | llvm-svn: 110315
* Emit standard-library RTTI with external linkage, not weak_odr.John McCall2010-08-041-0/+51
| | | | | | | | | | 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
* Change the name to something less terrible; suggestion by Doug. No ↵Argyrios Kyrtzidis2010-07-291-1/+1
| | | | | | functionality change. llvm-svn: 109797
* Merge PCHWriterDecl.cpp's isRequiredDecl and ↵Argyrios Kyrtzidis2010-07-291-154/+5
| | | | | | | | | | | | | | | 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
* we are not supposed to create an improper callsite using a CallInstr; leave ↵Gabor Greif2010-07-281-0/+1
| | | | | | a fixme mentioning the simplification when CallSite can clone itself llvm-svn: 109575
* Revert r109546, it broke linux build.Argyrios Kyrtzidis2010-07-271-60/+38
| | | | llvm-svn: 109550
* Merge PCHWriterDecl.cpp's isRequiredDecl and ↵Argyrios Kyrtzidis2010-07-271-38/+60
| | | | | | | | | | | | CodeGenModule::MayDeferGeneration into a new function, DeclIsRequiredFunctionOrFileScopedVar. This function is part of the public CodeGen interface since it's 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. This fixes current (and avoids future) codegen-from-PCH bugs. llvm-svn: 109546
* atch for implementation of objective-c's -WselectorFariborz Jahanian2010-07-221-2/+2
| | | | | | | warning flag in clang. Little more to do for a PCH issue. Radar 6507158. llvm-svn: 109129
* IRgen: Support user defined attributes on block runtime functions.Daniel Dunbar2010-07-161-0/+55
| | | | | | | | | | | | | | | | | | - 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
OpenPOWER on IntegriCloud