[LLVMdev] linux/x86-64 codegen support

Chris Lattner sabre at nondot.org
Sat Feb 16 15:22:04 PST 2008


On Feb 16, 2008, at 2:27 PM, Andrew Lenharth wrote:
> See the bug for a reduction and the gimple trees.  validate_arglist
> definately is rejecting the arglist in EmitBuiltinAlloca.
>
> (try:
> bool TreeToLLVM::EmitBuiltinAlloca(tree exp, Value *&Result) {
>  tree arglist = TREE_OPERAND(exp, 1);
>  if (!validate_arglist(arglist, INTEGER_TYPE, VOID_TYPE)) {
>    debug_tree(arglist);
>    return false;
>  }
>  Value *Amt = Emit(TREE_VALUE(arglist), 0);
>  Amt = CastToSIntType(Amt, Type::Int32Ty);
>  Result = Builder.CreateAlloca(Type::Int8Ty, Amt, "tmp");
>  return true;
> }
> for a pretty (?) print of the tree at that point)

This is very strange.  I built a cross compiler to x86_64-unknown- 
linux-gnu and it seems to work for me:

./cc1 /Users/sabre/pr1711.c -emit-llvm -quiet -O2 -o -

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32- 
i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64- 
f80:128:128"
target triple = "x86_64-unknown-linux-gnu"
	%struct.cpp_reader = type opaque

define i32 @_cpp_interpret_identifier(%struct.cpp_reader* %pfile, i8*  
%id, i64 %len) nounwind  {
entry:
	ret i32 undef
}

-Chris



More information about the llvm-dev mailing list