aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen
AgeCommit message (Collapse)AuthorFilesLines
2011-07-26Disable the optimization that skips emission of complete, non-virtualDouglas Gregor1-5/+1
destructors of abstract classes. It's undefined behavior to actually call the destructor (e.g., via delete), but the presence of code that calls this destructor doesn't make the program ill-formed. Fixes <rdar://problem/9819242>. llvm-svn: 136180
2011-07-25Rename getInstantiationLineNumber to getExpansionLineNumber in bothChandler Carruth2-4/+3
SourceManager and FullSourceLoc. llvm-svn: 135969
2011-07-25Mechanically rename SourceManager::getInstantiationLoc andChandler Carruth1-2/+2
FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part of the API and documentation update from 'instantiation' as the term for macros to 'expansion'. llvm-svn: 135914
2011-07-25Shorten some expressions by using ArrayRef::slice().Frits van Bommel1-6/+3
llvm-svn: 135910
2011-07-23fix PR10415, tidying up IR representation of module level inline asmChris Lattner1-0/+2
to avoid extraneous \n's. llvm-svn: 135862
2011-07-23Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon ↵Chris Lattner4-6/+6
Mulder! llvm-svn: 135855
2011-07-23remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner33-339/+338
LLVM.h imports them into the clang namespace. llvm-svn: 135852
2011-07-23clean up forward declarations of raw_ostream to use the new LLVM.hChris Lattner2-5/+6
patch by Jon Mulder! llvm-svn: 135851
2011-07-22Document the existing objc_precise_lifetime attribute.John McCall1-18/+68
Introduce and document a new objc_returns_inner_pointer attribute, and consume it by performing a retain+autorelease on message receivers when they're not immediately loaded from an object with precise lifetime. llvm-svn: 135764
2011-07-22Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to useJay Foad6-11/+8
ArrayRef. llvm-svn: 135761
2011-07-22fix PR10384: C++ allows external arrays of incomplete type as well.Chris Lattner1-0/+8
Many thanks to Eli for reducing this great testcase. llvm-svn: 135752
2011-07-22In ARC, non-atomic getters do not need to retain and autoreleaseJohn McCall1-17/+20
their loaded values, although it still worth doing this for __weak properties to get the autoreleased-return-value optimization. llvm-svn: 135747
2011-07-22Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.Jordy Rose5-43/+33
This was previously not-const only because it has to lazily construct a chain of ivars the first time it is called (and after the chain is invalidated). In practice, all the clients were just const_casting their const Decls; all those now-unnecessary const_casts have been removed. llvm-svn: 135741
2011-07-21Convert ConstantExpr::getGetElementPtr andJay Foad6-14/+14
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673
2011-07-20Unbreak build after API change.Benjamin Kramer1-6/+7
llvm-svn: 135585
2011-07-20add raw_ostream and Twine to LLVM.h, eliminating a ton of llvm:: qualifications.Chris Lattner2-8/+8
llvm-svn: 135577
2011-07-20now that we have a centralized place to do so, add some using declarations forChris Lattner11-58/+59
some common llvm types: stringref and smallvector. This cleans up the codebase quite a bit. llvm-svn: 135576
2011-07-20fix rdar://9780211 - Clang crashes with an assertion failure building ↵Chris Lattner1-1/+5
WKView.mm from WebKit This is something of a hack, the problem is as follows: 1. we instantiate both copied of RetainPtr with the two different argument types (an id and protocol-qualified id). 2. We refer to the ctor of one of the instantiations when introducing global "x", this causes us to emit an llvm::Function for a prototype whose "this" has type "RetainPtr<id<bork> >*". 3. We refer to the ctor of the other instantiation when introducing global "y", however, because it *mangles to the same name as the other ctor* we just use a bitcasted version of the llvm::Function we previously emitted. 4. We emit deferred declarations, causing us to emit the body of the ctor, however the body we emit is for RetainPtr<id>, which expects its 'this' to have an IR type of "RetainPtr<id>*". Because of the mangling collision, we don't have this case, and explode. This is really some sort of weird AST invariant violation or something, but hey a bitcast makes the pain go away. llvm-svn: 135572
2011-07-20fix a case where we're using ConvertType for a memory object.Chris Lattner1-1/+1
It doesn't matter in practice, but it is good to be tidy. llvm-svn: 135571
2011-07-20as eli points out, we're not doing memory stuff here. While ConvertType Chris Lattner2-3/+2
and ConvertTypeForMem are the same for pointers, it is best to just use ConvertType. Thanks Eli! llvm-svn: 135567
2011-07-20fix PR10395 - array decay can produce an interesting type whenChris Lattner1-1/+4
decaying an array of incomplete type (which has type [0 x i8]*) to a normal pointer (which has incompletetype*). llvm-svn: 135565
2011-07-19Match createTargetMachine API change.Evan Cheng1-11/+13
llvm-svn: 135469
2011-07-19Simplify.Devang Patel1-6/+2
llvm-svn: 135456
2011-07-18Check column number also.Devang Patel1-3/+5
llvm-svn: 135437
2011-07-18Migrate LLVM and Clang to use the new makeArrayRef(...) functions where ↵Frits van Bommel2-9/+6
previously explicit non-default constructors were used. Mostly mechanical with some manual reformatting. llvm-svn: 135390
2011-07-18In C99, emit an inline function when encountering an extern redeclaration.Nick Lewycky1-2/+15
Fixes PR10233! llvm-svn: 135377
2011-07-18de-constify llvm::Type, patch by David Blaikie!Chris Lattner35-452/+452
llvm-svn: 135370
2011-07-15Fix typoJoerg Sonnenberger1-1/+1
llvm-svn: 135285
2011-07-15Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad11-66/+69
llvm-svn: 135265
2011-07-15Fix the definition of AsTypeExpr. I'm still not sure thisJohn McCall1-1/+1
is right --- shouldn't there be a TypeLoc in here somewhere? --- but at least it doesn't have a redundant QualType and a broken children() method. Noticed this while doing things in serialization. llvm-svn: 135257
2011-07-15protect some calls to ConvertType when a function info is under constructionChris Lattner1-3/+3
to prevent recursive compilation problems. This fixes a failure of CodeGen/decl.c on x86-32 targets that don't fill in the coerce-to type. llvm-svn: 135256
2011-07-15Enhance the IR type lowering code to be much smarter about recursively loweringChris Lattner3-68/+172
types. Fore xample, we used to lower: struct bar { int a; }; struct foo { void (*FP)(struct bar); } G; to: %struct.foo = type { {}* } since the function pointer would cause recursive translation of bar and we didn't know if that would get us into trouble. We are now smart enough to know that it is fine, so we get this type instead: %struct.foo = type { void (i32)* } Codegen still needs to be prepared for uncooperative types at any place, which is why I let the maximally uncooperative code sit around for awhile to help shake out the bugs. llvm-svn: 135244
2011-07-15Create a new expression node, SubstNonTypeTemplateParmExpr,John McCall5-0/+17
to represent a fully-substituted non-type template parameter. This should improve source fidelity, as well as being generically useful for diagnostics and such. llvm-svn: 135243
2011-07-14Change intrinsic getter to take an ArrayRef, now that the underlying ↵Benjamin Kramer7-113/+105
function in LLVM does. llvm-svn: 135155
2011-07-13Reapply r134946 with fixes. Tested on Benjamin testcase and other test-suite ↵Bruno Cardoso Lopes1-2/+10
failures. llvm-svn: 135091
2011-07-13Emit debug info for extended vectors.Devang Patel1-3/+0
llvm-svn: 135083
2011-07-13Don't crash if defining -dealloc in a category.John McCall1-3/+5
llvm-svn: 135054
2011-07-13Okay, that rule about zero-length arrays applies to destroyingJohn McCall3-53/+38
them, too. llvm-svn: 135038
2011-07-13Arrays are permitted to be zero-length in some situations.John McCall2-27/+27
llvm-svn: 135036
2011-07-13Convert the standard default-construction loops to use phis andJohn McCall2-84/+103
partial destruction. llvm-svn: 135033
2011-07-13per john's advice, speculatively lower uses of forward-declared enums toChris Lattner1-5/+12
i32. They almost always end up this way in the end anyway, and if we get lucky, this avoids generating some bitcasts. llvm-svn: 135032
2011-07-13PR10337 reminds me that calls return values, lets handle them justChris Lattner1-3/+9
like arguments. Thanks PR10337! :) llvm-svn: 135030
2011-07-13Aggressive dead code elimination.John McCall2-80/+0
llvm-svn: 135029
2011-07-13Generalize the routine for destroying an object with staticJohn McCall2-49/+55
storage duration, then explicitly exempt ownership-qualified types from it. llvm-svn: 135028
2011-07-13Switch delete[] IR-generation over to the destroy framework,John McCall1-78/+38
which implicitly makes it EH-safe as well. llvm-svn: 135025
2011-07-13When compiling ::delete for a class with a virtual destructor, callDouglas Gregor1-4/+19
the complete destructor and then invoke the global delete operator. Previously, we would invoke the deleting destructor, which calls the wrong delete operator. Fixes PR10341. llvm-svn: 135021
2011-07-12Revert r134946Bruno Cardoso Lopes1-8/+1
llvm-svn: 135004
2011-07-12Generalize Cleanup::Emit's "isForEH" parameter into a setJohn McCall12-54/+89
of flags. No functionality change. llvm-svn: 134997
2011-07-12Add more compiler workarounds. Should fix the build with old GCCs and MSVC.Benjamin Kramer1-6/+10
llvm-svn: 134995
2011-07-12Ugh, use this compiler workaround again.John McCall1-3/+5
llvm-svn: 134989