[LLVMdev] Throws Intrinsic property

Richard Gorton rcgorton at cognitive-electronics.com
Thu Jun 26 06:39:50 PDT 2014


I believe I have come across a possible bug related to the 'Throws' Intrinsic property.
I'm in the process of migrating our code base from llvm3.3.1 to 3.4.2.

In include/llvm/IR/IntrinsicsCogE.td (our architecture is 'CogE'), I have this:
…
def int_coge_throw: GCCBuiltin<"__builtin_coge_throw">,
    Intrinsic<[], [llvm_i64_ty], [Throws]>;

Which causes a compile time error:
/localspace/rcgorton/svn/Compiler/trunk/LLVM3_4/llvm-3.4.2.src/lib/IR/Function.cpp: In function ‘llvm::AttributeSet llvm::Intrinsic::getAttributes(llvm::LLVMContext&, llvm::Intrinsic::ID)’:
/localspace/rcgorton/svn/Compiler/trunk/LLVM3_4/llvm-3.4.2.src/lib/IR/Function.cpp:683: error: a function-definition is not allowed here before ‘{’ token
In file included from /localspace/rcgorton/svn/Compiler/trunk/LLVM3_4/llvm-3.4.2.src/lib/IR/Function.cpp:693:
/localspace/rcgorton/svn/Compiler/trunk/LLVM3_4/scratchbuild/include/llvm/IR/Intrinsics.gen:36003: error: a function-definition is not allowed here before ‘{’ token
/localspace/rcgorton/svn/Compiler/trunk/LLVM3_4/llvm-3.4.2.src/lib/IR/Function.cpp:768: error: expected ‘}’ at end of input
make[1]: *** [/localspace/rcgorton/svn/Compiler/trunk/LLVM3_4/scratchbuild/lib/IR/Debug+Asserts/Function.o] Error 1
make[1]: Leaving directory `/localspace/rcgorton/svn/Compiler/trunk/LLVM3_4/scratchbuild/lib/IR'


But if I remove the "Throws" property from the intrinsic op, everything compiles cleanly.

For now, I am removing "Throws" from all of our intrinsics which utilize it.


Regards,

	Richard Gorton
	Cognitive Electronics
	www.cog-e.com





More information about the llvm-dev mailing list