<div dir="ltr"><div><div><div><div>Hi Bill,<br><br></div>With the latest llvm version I'm getting the following error:<br><br>opt -instnamer < core-device.c.bc > core-device.o.bc <br>Attribute 'nobuiltin' only applies to functions!<br>
void (%struct.fw_csr_iterator*, i32*)* @fw_csr_iterator_init<br>Broken module found, compilation aborted!<br>0  opt             0x0000000001914bf1 llvm::sys::PrintStackTrace(_IO_FILE*) + 38<br>1  opt             0x0000000001914e78<br>
2  opt             0x00000000019148bc<br>3  libpthread.so.0 0x00000035d980efe0<br>4  libc.so.6       0x00000035d8c35935 gsignal + 53<br>5  libc.so.6       0x00000035d8c370e8 abort + 328<br>6  opt             0x00000000017ee645<br>
7  opt             0x00000000017ee33d<br>8  opt             0x00000000017cccad llvm::FPPassManager::runOnFunction(llvm::Function&) + 385<br>9  opt             0x00000000017cce9e llvm::FPPassManager::runOnModule(llvm::Module&) + 84<br>
10 opt             0x00000000017cd1fb llvm::MPPassManager::runOnModule(llvm::Module&) + 559<br>11 opt             0x00000000017cd7fd llvm::PassManagerImpl::run(llvm::Module&) + 249<br>12 opt             0x00000000017cda0f llvm::PassManager::run(llvm::Module&) + 39<br>
13 opt             0x000000000090ab1b main + 5486<br>14 libc.so.6       0x00000035d8c21735 __libc_start_main + 245<br>15 opt             0x00000000008fc7c9<br>Stack dump:<br>0.    Program arguments: /home/scratch/llvm/build/bin/opt -instnamer <br>
1.    Running pass 'Function Pass Manager' on module '<stdin>'.<br>2.    Running pass 'Module Verifier' on function '@fw_csr_iterator_init'<br>Aborted<br><br></div>The bytecode of the function is:<br>
; Function Attrs: noredzone nounwind<br>define void @fw_csr_iterator_init(%struct.fw_csr_iterator* nocapture %ci, i32* %p) #1 {<br>  tail call void @llvm.dbg.value(metadata !{%struct.fw_csr_iterator* %ci}, i64 0, metadata !159), !dbg !3500<br>
  tail call void @llvm.dbg.value(metadata !{i32* %p}, i64 0, metadata !160), !dbg !3500<br>  %1 = getelementptr i32* %p, i64 1, !dbg !3501<br>  %2 = getelementptr inbounds %struct.fw_csr_iterator* %ci, i64 0, i32 0, !dbg !3501<br>
  store i32* %1, i32** %2, align 8, !dbg !3501<br>  %3 = load i32* %p, align 4, !dbg !3503<br>  %4 = lshr i32 %3, 16, !dbg !3503<br>  %5 = zext i32 %4 to i64, !dbg !3503<br>  %.sum = add i64 %5, 1, !dbg !3503<br>  %6 = getelementptr i32* %p, i64 %.sum, !dbg !3503<br>
  %7 = getelementptr inbounds %struct.fw_csr_iterator* %ci, i64 0, i32 1, !dbg !3503<br>  store i32* %6, i32** %7, align 8, !dbg !3503<br>  ret void, !dbg !3504<br>}<br><br></div>Can someone fix this or point me to where I should fix it?<br>
<br></div>Kind regards,<br>Marcelo<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 18, 2013 at 10:28 PM, Bill Wendling <span dir="ltr"><<a href="mailto:wendling@apple.com" target="_blank">wendling@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Marcelo,<br>
<br>
That should be fixed now at r184239. Sorry about the failure!<br>
<br>
-bw<br>
<div><div class="h5"><br>
On Jun 17, 2013, at 6:16 AM, Marcelo Sousa <<a href="mailto:marceloabsousa@gmail.com">marceloabsousa@gmail.com</a>> wrote:<br>
<br>
> Hello,<br>
><br>
> I'm getting an error when running opt with what seems to be a valid bytecode file compiled from one the Linux Kernel files.<br>
> The error is:<br>
> opt: /home/scratch/llvm/lib/IR/Attributes.cpp:119: llvm::StringRef llvm::Attribute::getKindAsString() const: Assertion `isStringAttribute() && "Invalid attribute type to get the kind as a string!"' failed.<br>

><br>
> I send you in attach the .{c,bc,ll} and the log file of the error.<br>
> Any insight on how to solve this would be quite helpful because it occurs in several bytecode files of the Linux Kernel source.<br>
><br>
> I'm using llvm-3.4svn.<br>
><br>
> Kind regards,<br>
> Marcelo<br>
</div></div>> <async.c><async.c.bc><async.c.ll><errorlog>_______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
</blockquote></div><br></div>