- Jul 07, 2010
-
-
John McCall authored
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
-
- Jul 06, 2010
-
-
John McCall authored
into IRBuilder. llvm-svn: 107687
-
John McCall authored
block before deleting it. Fixes PR7575. This really just a short-term fix before implementing lazy cleanups. llvm-svn: 107676
-
John McCall authored
as nounwind in -fno-exceptions. Fixes rdar://problem/8090834. llvm-svn: 107639
-
John McCall authored
self-host. Hopefully these results hold up on different platforms. I tried to keep the GNU ObjC runtime happy, but it's hard for me to test. Reimplement how clang generates IR for exceptions. Instead of creating new invoke destinations which sequentially chain to the previous destination, push a more semantic representation of *why* we need the cleanup/catch/filter behavior, then collect that information into a single landing pad upon request. Also reorganizes how normal cleanups (i.e. cleanups triggered by non-exceptional control flow) are generated, since it's actually fairly closely tied in with the former. Remove the need to track which cleanup scope a block is associated with. Document a lot of previously poorly-understood (by me, at least) behavior. The new framework implements the Horrible Hack (tm), which requires every landing pad to have a catch-all so that inlining will work. Clang no longer requires the Horrible Hack just to make exceptions flow correctly within a function, however. The HH is an unfortunate requirement of LLVM's EH IR. llvm-svn: 107631
-
- Jul 05, 2010
-
-
Chris Lattner authored
coerce cases (e.g. {double,int}) which avoids fastisel bailing out at -O0. llvm-svn: 107628
-
Chris Lattner authored
alloca for an argument. Make sure the argument gets the proper decl alignment, which may be different than the type alignment. This fixes PR7567 llvm-svn: 107627
-
Chris Lattner authored
wasn't handling array padding elements right. llvm-svn: 107621
-
Chris Lattner authored
Everyone knows that no bugs are ever possible with bitfields. llvm-svn: 107620
-
- Jul 03, 2010
-
-
Charles Davis authored
ObjC pointers were easy enough (as far as the ABI is concerned, they're just pointers to structs), but I had to invent a new mangling for block pointers. This is particularly worrying with the Microsoft ABI, because it is a vendor-specific ABI; extending it could come back to bite us later when MS extends it on their own (and you know they will). llvm-svn: 107572
-
John McCall authored
point. llvm-svn: 107570
-
Charles Davis authored
llvm-svn: 107568
-
Charles Davis authored
llvm-svn: 107567
-
Charles Davis authored
llvm-svn: 107564
-
Charles Davis authored
Only actual functions get mangled correctly; I don't know how to fix it for function pointers yet. Thanks to John McCall for the hint. Also, mangle anonymous tag types. I don't have a suitable testcase yet; I have a feeling that that's going to need support for static locals, and I haven't figured out exactly how MSVC's scheme for mangling those works. llvm-svn: 107561
-
- Jul 01, 2010
-
-
Douglas Gregor authored
CXXRecordDecl::getDestructor(); no functionality change. llvm-svn: 107394
-
-
Daniel Dunbar authored
llvm-svn: 107367
-
Daniel Dunbar authored
scope hasn't been set up yet so this isn't valid. It was just a cleanup to the IR, so I'm going to ignore it for now. llvm-svn: 107356
-
- Jun 30, 2010
-
-
Daniel Dunbar authored
store make sure to move the debug metadata from the store (which is actual 'return' statement location) to the return instruction (which otherwise would have the function end location as its debug info). - Tested by gdb test suite. llvm-svn: 107322
-
Daniel Dunbar authored
llvm-svn: 107320
-
Chris Lattner authored
r107173, "fix PR7519: after thrashing around and remembering how all this stuff" r107216, "fix PR7523, which was caused by the ABI code calling ConvertType instead" This includes a fix to make ConvertTypeForMem handle the "recursive" case, and call it as such when lowering function types which have an indirect result. llvm-svn: 107310
-
Fariborz Jahanian authored
in method/blocks to decide not to mangle them. llvm-svn: 107309
-
Fariborz Jahanian authored
should not be mangled either. Fixes radar 8016412. llvm-svn: 107303
-
Chris Lattner authored
llvm-svn: 107292
-
Charles Davis authored
doesn't mangle array parameters right), but I think that should be fixed in Sema (Doug, John, what do you think?). Also, stub out the remaining mangleType() routines. llvm-svn: 107264
-
Daniel Dunbar authored
Revert r107173, "fix PR7519: after thrashing around and remembering how all this stuff", it broke bootstrap. llvm-svn: 107232
-
Daniel Dunbar authored
Revert r107216, "fix PR7523, which was caused by the ABI code calling ConvertType instead", it is part of a boostrap breaking sequence. llvm-svn: 107231
-
Daniel Dunbar authored
complex values either. Previously we did this properly for regular assignment, but not for compound assignment. - Also, tidy up assignment code a bit to look more like the scalar path. llvm-svn: 107217
-
Chris Lattner authored
of ConvertTypeRecursive when it needed to in a few cases, causing pointer types to get resolved at the wrong time. llvm-svn: 107216
-
Daniel Dunbar authored
would trigger an extra method call). - While in the area, I also changed Clang to not emit an unnecessary load from 'x' in cases like 'y = (x = 1)'. llvm-svn: 107210
-
- Jun 29, 2010
-
-
Chris Lattner authored
it doesn't dangle as types get refined. This fixes Shootout-C++/lists1 and probably also PR7522. llvm-svn: 107196
-
Chris Lattner authored
of CanQualTypes to be passed in. llvm-svn: 107176
-
Chris Lattner authored
works, the fix is quite simple: just make sure to call ConvertTypeRecursive when the function type being lowered is in the midst of ConvertType. llvm-svn: 107173
-
Chris Lattner authored
llvm-svn: 107150
-
Chris Lattner authored
avoid passing ASTContext down through all the methods it has. When classifying an argument, or argument piece, as INTEGER, check to see if we have a pointer at exactly the same offset in the preferred type. If so, use that pointer type instead of i64. This allows us to compile A function taking a stringref into something like this: define i8* @foo(i64 %D.coerce0, i8* %D.coerce1) nounwind ssp { entry: %D = alloca %struct.DeclGroup, align 8 ; <%struct.DeclGroup*> [#uses=4] %0 = getelementptr %struct.DeclGroup* %D, i32 0, i32 0 ; <i64*> [#uses=1] store i64 %D.coerce0, i64* %0 %1 = getelementptr %struct.DeclGroup* %D, i32 0, i32 1 ; <i8**> [#uses=1] store i8* %D.coerce1, i8** %1 %tmp = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 0 ; <i64*> [#uses=1] %tmp1 = load i64* %tmp ; <i64> [#uses=1] %tmp2 = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 1 ; <i8**> [#uses=1] %tmp3 = load i8** %tmp2 ; <i8*> [#uses=1] %add.ptr = getelementptr inbounds i8* %tmp3, i64 %tmp1 ; <i8*> [#uses=1] ret i8* %add.ptr } instead of this: define i8* @foo(i64 %D.coerce0, i64 %D.coerce1) nounwind ssp { entry: %D = alloca %struct.DeclGroup, align 8 ; <%struct.DeclGroup*> [#uses=3] %0 = insertvalue %0 undef, i64 %D.coerce0, 0 ; <%0> [#uses=1] %1 = insertvalue %0 %0, i64 %D.coerce1, 1 ; <%0> [#uses=1] %2 = bitcast %struct.DeclGroup* %D to %0* ; <%0*> [#uses=1] store %0 %1, %0* %2, align 1 %tmp = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 0 ; <i64*> [#uses=1] %tmp1 = load i64* %tmp ; <i64> [#uses=1] %tmp2 = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 1 ; <i8**> [#uses=1] %tmp3 = load i8** %tmp2 ; <i8*> [#uses=1] %add.ptr = getelementptr inbounds i8* %tmp3, i64 %tmp1 ; <i8*> [#uses=1] ret i8* %add.ptr } This implements rdar://7375902 - [codegen quality] clang x86-64 ABI lowering code punishing StringRef llvm-svn: 107123
-
Chris Lattner authored
no functionality change. llvm-svn: 107115
-
Chris Lattner authored
This is somewhat annoying to do this at this level, but it avoids having ABIInfo know depend on CodeGenTypes for a hint. Nothing is using this yet, so no functionality change. llvm-svn: 107111
-
Chris Lattner authored
llvm-svn: 107105
-
Chris Lattner authored
avoiding making the FCA at all when the types exactly line up. For example, before we made: %struct.DeclGroup = type { i64, i64 } define i64 @_Z3foo9DeclGroup(i64, i64) nounwind { entry: %D = alloca %struct.DeclGroup, align 8 ; <%struct.DeclGroup*> [#uses=3] %2 = insertvalue %struct.DeclGroup undef, i64 %0, 0 ; <%struct.DeclGroup> [#uses=1] %3 = insertvalue %struct.DeclGroup %2, i64 %1, 1 ; <%struct.DeclGroup> [#uses=1] store %struct.DeclGroup %3, %struct.DeclGroup* %D %tmp = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 0 ; <i64*> [#uses=1] %tmp1 = load i64* %tmp ; <i64> [#uses=1] %tmp2 = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 1 ; <i64*> [#uses=1] %tmp3 = load i64* %tmp2 ; <i64> [#uses=1] %add = add nsw i64 %tmp1, %tmp3 ; <i64> [#uses=1] ret i64 %add } ... which has the pointless insertvalue, which fastisel hates, now we make: %struct.DeclGroup = type { i64, i64 } define i64 @_Z3foo9DeclGroup(i64, i64) nounwind { entry: %D = alloca %struct.DeclGroup, align 8 ; <%struct.DeclGroup*> [#uses=4] %2 = getelementptr %struct.DeclGroup* %D, i32 0, i32 0 ; <i64*> [#uses=1] store i64 %0, i64* %2 %3 = getelementptr %struct.DeclGroup* %D, i32 0, i32 1 ; <i64*> [#uses=1] store i64 %1, i64* %3 %tmp = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 0 ; <i64*> [#uses=1] %tmp1 = load i64* %tmp ; <i64> [#uses=1] %tmp2 = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 1 ; <i64*> [#uses=1] %tmp3 = load i64* %tmp2 ; <i64> [#uses=1] %add = add nsw i64 %tmp1, %tmp3 ; <i64> [#uses=1] ret i64 %add } This only kicks in when x86-64 abi lowering decides it likes us. llvm-svn: 107104
-