summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* PR10120: Make CodeGenModule::getVTableLinkage use NamedDecl::getLinkage to ↵Eli Friedman2011-06-101-1/+1
| | | | | | | | determine whether the vtable should be externally visible, instead of a rough approximation of it which messes up with templates. While I'm here, zap the other user of isInAnonymousNamespace outside of Decl.cpp. llvm-svn: 132861
* When inferring the result type of a block based on a return statementDouglas Gregor2011-06-051-0/+1
| | | | | | | | with a type-dependent expression, infer the placeholder type 'Context.DependentTy' to indicate that this is just a placeholder. Fixes PR9982 / <rdar://problem/9486685>. llvm-svn: 132657
* Match llvm-gcc's string literals alignment by forcing alignment on string ↵Eli Friedman2011-05-271-0/+1
| | | | | | literals to 1. This can significantly impact the size of the string data, and as far as I know, the alignment doesn't help performance. rdar://9078969 . llvm-svn: 132223
* Update for llvm api change.Rafael Espindola2011-05-251-0/+3
| | | | llvm-svn: 132034
* Code cleanup of my last patch.Fariborz Jahanian2011-05-171-13/+8
| | | | llvm-svn: 131499
* Patch to fix IR-gen crash generating structure ABI which implementsFariborz Jahanian2011-05-171-14/+21
| | | | | | | user specified string class via -fconstant-string-class option. pr9914. llvm-svn: 131496
* Use arrays and SmallVectors instead of std::vectors when building functionJohn McCall2011-05-151-21/+14
| | | | | | | types. Also, cache a translation of 'void' in CGM and provide a ptrdiff_t alias. No functionality change. llvm-svn: 131373
* SimplifyJoerg Sonnenberger2011-05-131-1/+1
| | | | llvm-svn: 131321
* Bug 8765: Honor assembler labels for builtins. Ensure that the label isJoerg Sonnenberger2011-05-131-4/+14
| | | | | | | mangled to avoid doing it twice for platforms that use prefixes like Darwin. llvm-svn: 131311
* Produce UTF-8 strings with -fconstant-string-classFariborz Jahanian2011-05-131-21/+15
| | | | | | -fno-constant-cfstrings. Patch by Jonathan Schleifer. llvm-svn: 131298
* When determining whether we can make a declaration into a globalDouglas Gregor2011-05-131-1/+3
| | | | | | | constant, also consider whether it's a class type that has any mutable fields. If so, it can't be a global constant. llvm-svn: 131276
* In C++, allow us to emit a global as 'constant' even if it has classDouglas Gregor2011-05-071-7/+10
| | | | | | | type, so long as it is known to have a constant initializer and the class type is a POD class. Fixes <rdar://problem/9306265>. llvm-svn: 131060
* Modify some deleted function methods to better reflect reality:Alexis Hunt2011-05-061-2/+2
| | | | | | | | | | | | | | | | | | | | - New isDefined() function checks for deletedness - isThisDeclarationADefinition checks for deletedness - New doesThisDeclarationHaveABody() does what isThisDeclarationADefinition() used to do - The IsDeleted bit is not propagated across redeclarations - isDeleted() now checks the canoncial declaration - New isDeletedAsWritten() does what it says on the tin. - isUserProvided() now correct (thanks Richard!) This fixes the bug that we weren't catching void foo() = delete; void foo() {} as being a redefinition. llvm-svn: 131013
* Add an implementation of thunks for varargs methods. The implementation is ↵Eli Friedman2011-05-061-5/+10
| | | | | | a bit messy, but it is correct as long as the method in question doesn't use indirect gotos. A couple of possible alternative implementations are outlined in FIXME's in this patch. rdar://problem/8077308 . llvm-svn: 130993
* Implement support for C++0x alias templates.Richard Smith2011-05-051-0/+1
| | | | llvm-svn: 130953
* Preserve the full name of the file, so that '-c -o foo.pic.o' producesNick Lewycky2011-05-051-6/+6
| | | | | | foo.pic.gcno instead of foo.gcno. llvm-svn: 130899
* Record where the GCOV data files should be placed.Nick Lewycky2011-05-041-0/+20
| | | | llvm-svn: 130866
* Add -fdelayed-template-parsing option. Using this option all templated ↵Francois Pichet2011-04-221-2/+6
| | | | | | | | | function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup. Using this flag is necessary for compatibility with Microsoft template code. This also provides some parsing speed improvement. llvm-svn: 130022
* Wire up the -ftest-coverage and -fprofile-arcs flags to .gcno file emission (atNick Lewycky2011-04-211-3/+6
| | | | | | | | | compile time) and .gcda emission (at runtime). --coverage enables both. This does not yet add the profile_rt library to the link step if -fprofile-arcs is enabled when linking. llvm-svn: 129956
* PR9214: Convert Metadata API to use ArrayRef.Jay Foad2011-04-211-2/+2
| | | | llvm-svn: 129929
* ADT/Triple: Switch to using .isOSDarwin() predicate.Daniel Dunbar2011-04-191-1/+1
| | | | llvm-svn: 129823
* IRgen/Obj-C: Emit CFStrings and NSStrings with the alignment of the char type,Daniel Dunbar2011-04-121-0/+6
| | | | | | | | | | there is no reason to align them higher. - This roughly matches llvm-gcc's r126913. - It is an open question whether or not we should do this for cstring's in general (code size vs optimization potential), for now we just match llvm-gcc until someone wants to run some experiments. llvm-svn: 129410
* Template static data members can have weak_odr linkage, not justJohn McCall2011-04-121-3/+1
| | | | | | | | weak linkage. Also, fix a problem where global weak variables with non-trivial initializers were getting guard variables, or at least were checking for them and then crashing. llvm-svn: 129342
* Ignore indirect field declarations. Fixes PR9570.John McCall2011-04-121-0/+5
| | | | llvm-svn: 129337
* After some discussion with Doug, we decided that it made a lot more senseJohn McCall2011-04-121-48/+0
| | | | | | | | | for __unknown_anytype resolution to destructively modify the AST. So that's what it does now, which significantly simplifies some of the implementation. Normal member calls work pretty cleanly now, and I added support for propagating unknown-ness through &. llvm-svn: 129331
* fix indentationChris Lattner2011-04-091-7/+6
| | | | llvm-svn: 129202
* Basic, untested implementation for an "unknown any" type requested by LLDB.John McCall2011-04-071-1/+49
| | | | | | | | | | | | The idea is that you can create a VarDecl with an unknown type, or a FunctionDecl with an unknown return type, and it will still be valid to access that object as long as you explicitly cast it at every use. I'm still going back and forth about how I want to test this effectively, but I wanted to go ahead and provide a skeletal implementation for the LLDB folks' benefit and because it also improves some diagnostic goodness for placeholder expressions. llvm-svn: 129065
* If this is an intrinsic function, set the function's attributes to the ↵Peter Collingbourne2011-04-061-0/+7
| | | | | | intrinsic's attributes. llvm-svn: 129000
* On Mac OS X, the presence of an 'availability' attribute for thatDouglas Gregor2011-03-261-1/+1
| | | | | | | | | platform implies default visibility. To achieve these, refactor our lookup of explicit visibility so that we search for both an explicit VisibilityAttr and an appropriate AvailabilityAttr, favoring the VisibilityAttr if it is present. llvm-svn: 128336
* Update type cache when a type is completed.Devang Patel2011-03-231-0/+7
| | | | | | Radar 9168773 llvm-svn: 128150
* Implement a new 'availability' attribute, that allows one to specifyDouglas Gregor2011-03-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which versions of an OS provide a certain facility. For example, void foo() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6))); says that the function "foo" was introduced in 10.2, deprecated in 10.4, and completely obsoleted in 10.6. This attribute ties in with the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that we want to deploy back to Mac OS X 10.1). There are several concrete behaviors that this attribute enables, as illustrated with the function foo() above: - If we choose a deployment target >= Mac OS X 10.4, uses of "foo" will result in a deprecation warning, as if we had placed attribute((deprecated)) on it (but with a better diagnostic) - If we choose a deployment target >= Mac OS X 10.6, uses of "foo" will result in an "unavailable" warning (in C)/error (in C++), as if we had placed attribute((unavailable)) on it - If we choose a deployment target prior to 10.2, foo() is weak-imported (if it is a kind of entity that can be weak imported), as if we had placed the weak_import attribute on it. Naturally, there can be multiple availability attributes on a declaration, for different platforms; only the current platform matters when checking availability attributes. The only platforms this attribute currently works for are "ios" and "macosx", since we already have -mxxxx-version-min flags for them and we have experience there with macro tricks translating down to the deprecated/unavailable/weak_import attributes. The end goal is to open this up to other platforms, and even extension to other "platforms" that are really libraries (say, through a #pragma clang define_system), but that hasn't yet been designed and we may want to shake out more issues with this narrower problem first. Addresses <rdar://problem/6690412>. As a drive-by bug-fix, if an entity is both deprecated and unavailable, we only emit the "unavailable" diagnostic. llvm-svn: 128127
* Simplify Mac runtime selection - it's the factory function's job to select ↵David Chisnall2011-03-221-10/+2
| | | | | | which class to produce, not CodeGenModule's. llvm-svn: 128109
* The emission of an Objective-C++'s class .cxx_destruct method should beJohn McCall2011-03-221-17/+28
| | | | | | | conditioned on whether it has any destructible ivars, not on whether it has any non-trivial class-object initializers. llvm-svn: 128074
* Add support for language-specific address spaces. On top of that,Peter Collingbourne2011-03-181-2/+3
| | | | | | | | | add support for the OpenCL __private, __local, __constant and __global address spaces, as well as the __read_only, _read_write and __write_only image access specifiers. Patch originally by ARM; language-specific address space support by myself. llvm-svn: 127915
* The Darwin kernel does not provide useful guard variable support.John McCall2011-03-181-0/+5
| | | | | | | | 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
* 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
OpenPOWER on IntegriCloud