[llvm-commits] [llvm] r73646 - /llvm/trunk/include/llvm/Support/IRBuilder.h

Bill Wendling isanbard at gmail.com
Wed Jun 17 15:40:51 PDT 2009


Hi Anton,

This might be causing this failure on Darwin:

Running /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-i386-darwin9/build/llvm.src/test/FrontendC/dg.exp
...
FAIL: /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-i386-darwin9/build/llvm.src/test/FrontendC/2007-09-20-GcrootAttribute.c
Failed with exit(1) at line 1
while running: /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-i386-darwin9/build/llvm-gcc.install/bin/llvm-gcc
-m32 -fstrict-aliasing -Wstrict-aliasing
-I/usr/include/c++/4.0.0/i686-apple-darwin9 -I/usr/include/c++/4.0.0
-emit-llvm -w -S -emit-llvm
/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-i386-darwin9/build/llvm.src/test/FrontendC/2007-09-20-GcrootAttribute.c
-o - | /usr/bin/grep llvm.gcroot
	call void @llvm.gcroot(i8** %2, i8* null) nounwind
declare void @llvm.gcroot(i8**, i8*) nounwind
	call void @llvm.gcroot(i8** %1, i8* null) nounwind
	call void @llvm.gcroot(i8** %2, i8* null) nounwind
	call void @llvm.gcroot(i8** %3, i8* null) nounwind
	call void @llvm.gcroot(i8** %4, i8* null) nounwind
Assertion failed: (InternTable.empty() && "PooledStringPtr leaked!"),
function ~StringPool, file
/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-i386-darwin9/build/llvm.src/lib/Support/StringPool.cpp,
line 22.
/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-i386-darwin9/build/llvm.src/test/FrontendC/2007-09-20-GcrootAttribute.c:29:
internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://llvm.org/bugs/> for instructions.

Could you check? :-)

-bw

On Wed, Jun 17, 2009 at 3:20 PM, Anton Korobeynikov<asl at math.spbu.ru> wrote:
> Author: asl
> Date: Wed Jun 17 17:20:46 2009
> New Revision: 73646
>
> URL: http://llvm.org/viewvc/llvm-project?rev=73646&view=rev
> Log:
> Honour calling convention and attributes of Callee by default.
>
> Modified:
>    llvm/trunk/include/llvm/Support/IRBuilder.h
>
> Modified: llvm/trunk/include/llvm/Support/IRBuilder.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRBuilder.h?rev=73646&r1=73645&r2=73646&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/IRBuilder.h (original)
> +++ llvm/trunk/include/llvm/Support/IRBuilder.h Wed Jun 17 17:20:46 2009
> @@ -17,6 +17,7 @@
>
>  #include "llvm/Constants.h"
>  #include "llvm/Instructions.h"
> +#include "llvm/GlobalAlias.h"
>  #include "llvm/GlobalVariable.h"
>  #include "llvm/Function.h"
>  #include "llvm/Support/ConstantFolder.h"
> @@ -586,32 +587,49 @@
>     return Insert(PHINode::Create(Ty), Name);
>   }
>
> +  CallInst *TransferAttributes(CallInst *CI, const Value* Callee) const {
> +    if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(Callee))
> +      Callee = GA->getAliasedGlobal();
> +
> +    if (const Function *F = dyn_cast<Function>(Callee)) {
> +      CI->setCallingConv(F->getCallingConv());
> +      CI->setAttributes(F->getAttributes());
> +    }
> +
> +    return CI;
> +  }
> +
>   CallInst *CreateCall(Value *Callee, const char *Name = "") {
> -    return Insert(CallInst::Create(Callee), Name);
> +    return Insert(TransferAttributes(CallInst::Create(Callee), Callee), Name);
>   }
>   CallInst *CreateCall(Value *Callee, Value *Arg, const char *Name = "") {
> -    return Insert(CallInst::Create(Callee, Arg), Name);
> +    return Insert(TransferAttributes(CallInst::Create(Callee, Arg),
> +                                     Callee), Name);
>   }
>   CallInst *CreateCall2(Value *Callee, Value *Arg1, Value *Arg2,
>                         const char *Name = "") {
>     Value *Args[] = { Arg1, Arg2 };
> -    return Insert(CallInst::Create(Callee, Args, Args+2), Name);
> +    return Insert(TransferAttributes(CallInst::Create(Callee, Args, Args+2),
> +                                     Callee), Name);
>   }
>   CallInst *CreateCall3(Value *Callee, Value *Arg1, Value *Arg2, Value *Arg3,
>                         const char *Name = "") {
>     Value *Args[] = { Arg1, Arg2, Arg3 };
> -    return Insert(CallInst::Create(Callee, Args, Args+3), Name);
> +    return Insert(TransferAttributes(CallInst::Create(Callee, Args, Args+3),
> +                                     Callee), Name);
>   }
>   CallInst *CreateCall4(Value *Callee, Value *Arg1, Value *Arg2, Value *Arg3,
>                         Value *Arg4, const char *Name = "") {
>     Value *Args[] = { Arg1, Arg2, Arg3, Arg4 };
> -    return Insert(CallInst::Create(Callee, Args, Args+4), Name);
> +    return Insert(TransferAttributes(CallInst::Create(Callee, Args, Args+4),
> +                                     Callee), Name);
>   }
>
>   template<typename InputIterator>
>   CallInst *CreateCall(Value *Callee, InputIterator ArgBegin,
>                        InputIterator ArgEnd, const char *Name = "") {
> -    return Insert(CallInst::Create(Callee, ArgBegin, ArgEnd), Name);
> +    return Insert(TransferAttributes(CallInst::Create(Callee, ArgBegin, ArgEnd),
> +                                     Callee), Name);
>   }
>
>   Value *CreateSelect(Value *C, Value *True, Value *False,
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list