Hi all, I've just finished updating my EDL frontend from LLVM3.0 to LLVM3.4, it wasn't too painful, however many of my programs are failing to verify after construction. Basically I get an error from the verifier e.g. : Attribute after last parameter! i1 ()* @PinGettest Broken module found, compilation aborted! After some digging, I've narrowed it down to the following : function->setOnlyReadsMemory(true); which is used for functions that are tied to reads on PINs, (EDL is a form of description language for emulators - a kind of hardware abstraction for chips). If I comment out the setOnlyReadsMemory, then the verifier completes fine. The call is made just after creating the function. I`m guessing the attribute changes between 3.1 and 3.4 are to blame, perhaps there is now an alternate way to specify this? Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140121/8d3edf6a/attachment.html>
fixed this issue. replaced offending line with : function->setAttributes(AttributeSet::get(getGlobalContext(),AttributeSet::FunctionIndex,Attribute::ReadOnly)); On Tue, Jan 21, 2014 at 8:45 AM, Lee Hammerton <savoury.snax at googlemail.com>wrote:> Hi all, > > > I've just finished updating my EDL frontend from LLVM3.0 to LLVM3.4, it > wasn't too painful, however many of my programs are failing to verify after > construction. Basically I get an error from the verifier e.g. : > > Attribute after last parameter! > i1 ()* @PinGettest > Broken module found, compilation aborted! > > After some digging, I've narrowed it down to the following : > > function->setOnlyReadsMemory(true); > > which is used for functions that are tied to reads on PINs, (EDL is a > form of description language for emulators - a kind of hardware abstraction > for chips). > > If I comment out the setOnlyReadsMemory, then the verifier completes > fine. The call is made just after creating the function. > > I`m guessing the attribute changes between 3.1 and 3.4 are to blame, > perhaps there is now an alternate way to specify this? > > Lee >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140121/e5291ca5/attachment.html>
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On Behalf Of Lee Hammerton > Subject: [LLVMdev] Attribute after last parameter!> After some digging, I've narrowed it down to the following : > function->setOnlyReadsMemory(true);To set the function attribute, you should be using just setOnlyReadsMemory(), without a parameter. With the parameter, you're telling it that the n'th (first, in this case) parameter is read-only. - Chuck