[llvm-commits] [llvm] r56704 - in /llvm/trunk: include/llvm/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Transforms/IPO/ lib/Transforms/Scalar/ lib/VMCore/

Devang Patel dpatel at apple.com
Mon Oct 6 10:53:52 PDT 2008


On Oct 4, 2008, at 11:33 AM, Dan Gohman wrote:

> Hi Devang,
>
> Something in the recent attribute changes is breaking
> backwards compatibility with bitcocde files produced by
> LLVM 2.2, and perhaps other versions, but that's what
> I have handy at the moment.
>
> If I take this testcase:
>
>
>  define i32 @foo() {
>          %t = call i32 @bar() nounwind readonly
>          ret i32 %t
>  }
>
>  declare i32 @bar() nounwind readonly
>
>
> Compiling with an LLVM 2.2 llvm-as and disassembling with a TOT
> llvm-dis, I get this:
>
>
>  define i32 @foo() {
>          %t = call nounwind readonly i32 @bar() nounwind readonly
>          ret i32 %t
>  }
>
>  declare nounwind readonly i32 @bar() nounwind readonly


>
> TOT llvm-as doesn't like that:
>  llvm-as: new.ll:4,0: new.ll:4: error: syntax error, unexpected  
> NOUNWIND
> while reading token: 'nounwind'
>
> Also, TOT llvm-ld similarly doesn't like 2.2-produced bitcode files,
> and gives this error:
>  Attribute nounwind only applies to return values!
>          %tmp7 = call nounwind i32 (...)* @atoi(i8* %tmp6) nounwind
>     ; <i32> [#uses=1]

Chris fixed these issues. Thanks Chris!

Note, if TOT assembled bc file is  disassembled by 2.2 llvm-dis then  
call instruction will lose nounwind and readonly attributes, as  
expected.

-
Devang






More information about the llvm-commits mailing list