summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove code that was intentionally generating bad code on the GNU runtime ↵David Chisnall2011-03-171-1/+1
| | | | | | for no reason (failing to emit .cxx_constructor / .cxx_destructor methods). llvm-svn: 127806
* Switch from internal to linker_private linkage, it is sufficient to please ↵Rafael Espindola2011-03-141-1/+1
| | | | | | the new linker. llvm-svn: 127622
* Fix link of libxul with LTO and the linker in xcode4. It is not clear if thisRafael Espindola2011-03-141-1/+4
| | | | | | | is working around a bug in ld or if the new linker has a reasonable reason for wanting the string constant to be linker visible. llvm-svn: 127594
* Fix three of the four places where I left breadcrumbs to avoid unnecessaryJohn McCall2011-03-091-3/+5
| | | | | | recomputation. llvm-svn: 127322
* Use the "undergoes default argument promotion" bit on parameters toJohn McCall2011-03-091-1/+6
| | | | | | | | | | 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-2/+2
| | | | | | 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/+1
| | | | | | | | | | | | | 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-8/+9
| | | | llvm-svn: 127082
* Reorganize the emission of local variables.John McCall2011-02-221-0/+2
| | | | llvm-svn: 126189
* Warn about code that uses variables and functions with internal linkageJohn McCall2011-02-191-1/+1
| | | | | | | | | | | | | | without defining them. This should be an error, but I'm paranoid about "uses" that end up not actually requiring a definition. I'll revisit later. Also, teach IR generation to not set internal linkage on variable declarations, just for safety's sake. Doing so produces an invalid module if the variable is not ultimately defined. Also, fix several places in the test suite where we were using internal functions without definitions. llvm-svn: 126016
* Assorted cleanup:John McCall2011-02-151-1/+11
| | | | | | | | | - 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
* Use raw_svector_ostream in more places in the mangler.Rafael Espindola2011-02-101-8/+12
| | | | llvm-svn: 125321
* When IRgen refers to a function declaration that is not a definition,Douglas Gregor2011-02-091-2/+2
| | | | | | | | | | and we later find the definition, make sure that we add the definition (not the declaration) to the list of deferred definitions to emit. Fixes PR8864. Thanks to Nick Lewycky for testing this patch out llvm-svn: 125157
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-081-11/+13
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* Re-land r124768, with a fix for PR9130.Anders Carlsson2011-02-051-8/+14
| | | | | | We now emit everything except unused implicit virtual member functions when building the vtable. llvm-svn: 124935
* minor refactoring of -fapple-kext stuff.Fariborz Jahanian2011-02-041-8/+6
| | | | llvm-svn: 124837
* What was I thinking?Fariborz Jahanian2011-02-041-3/+1
| | | | llvm-svn: 124835
* -fapple-kext cannot have 'weak' visibility in thisFariborz Jahanian2011-02-041-15/+32
| | | | | | abi. llvm-svn: 124834
* Revert 124768.Rafael Espindola2011-02-031-15/+8
| | | | | | | 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-8/+15
| | | | | | | | | | | 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
* Revert 124633. The linker has been told how to merge available_externally.Rafael Espindola2011-02-011-1/+2
| | | | llvm-svn: 124651
* Set visibility for available_externally globals. This is important for two ↵Rafael Espindola2011-02-011-2/+1
| | | | | | | | | | reasons: * llvm-link would complains about mismatched visibility * If we produce a relocation with an available_externally, it is good to know that it is hidden. llvm-svn: 124633
* When building with optimizations, emit vtables where the key is not in the Anders Carlsson2011-01-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | current translation unit as available_externally. This helps devirtualize the second example in PR3100, comment 18: struct S { S() {}; virtual void xyzzy(); }; inline void foo(S *s) { s->xyzzy(); } void bar() { S s; foo(&s); } This involved four major changes: 1. In DefineUsedVTables, always mark virtual member functions as referenced for non-template classes and class template specializations. 2. In CodeGenVTables::ShouldEmitVTableInThisTU return true if optimizations are enabled, even if the key function is not implemented in this translation unit. We don't ever do this for code compiled with -fapple-kext, because we don't ever want to devirtualize virtual member function calls in that case. 3. Give the correct linkage for vtables where the key function is not defined. 4. Update the linkage for RTTI structures when necessary. llvm-svn: 124565
* Move GetLLVMVisibility to CodeGenModule.Anders Carlsson2011-01-291-11/+0
| | | | llvm-svn: 124550
* Add RTTIBuilder::GetAddrOfTypeName which uses the newly added ↵Anders Carlsson2011-01-291-0/+4
| | | | | | | | CreateOrReplaceCXXRuntimeVariable. Set the visibility for typeinfo names. llvm-svn: 124548
* Change CodeGenModule::setTypeVisibility to take a TypeVisibilityKind enum ↵Anders Carlsson2011-01-291-2/+3
| | | | | | instead of an "IsForRTTI" flag. llvm-svn: 124546
* Replace an isa/cast with a dyn_cast.Anders Carlsson2011-01-291-2/+2
| | | | llvm-svn: 124542
* Get rid of an unneeded parameter from setGlobalVisibility.Anders Carlsson2011-01-291-7/+5
| | | | llvm-svn: 124541
* Use CGM.CreateOrReplaceCXXRuntimeVariable in CGVTables.cppAnders Carlsson2011-01-291-1/+1
| | | | llvm-svn: 124538
* Add a new function, to be used by CGRTTI, CGVTables and CGVTT (which each ↵Anders Carlsson2011-01-291-0/+39
| | | | | | has their own copy of this code). llvm-svn: 124537
* Replace a literal '8' with getCharWidth().Ken Dyck2011-01-291-2/+3
| | | | llvm-svn: 124536
* Remove IsDefinition from CodeGenModule::setTypeVisibility; it is always true.Anders Carlsson2011-01-291-3/+2
| | | | llvm-svn: 124529
* Mark VTables and RTTI data linkonce_odr instead of weak_odr, with the ↵Anders Carlsson2011-01-241-6/+10
| | | | | | | | exception of explicit template instantiations, which have to be weak_odr. This fixes PR6996. llvm-svn: 124089
* Use a FunctionType::get overload that doesn't require an empty vector.Benjamin Kramer2011-01-221-5/+2
| | | | llvm-svn: 124029
* 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
OpenPOWER on IntegriCloud