search for: getparamattr

Displaying 11 results from an estimated 11 matches for "getparamattr".

Did you mean: getparamattrs
2008 Apr 26
0
[LLVMdev] ParamAttr Patch - Alignment fix
...ByValParamAttr: A = ParamAttr::ByVal; break; > + case LLVMNestParamAttr: A = ParamAttr::Nest; break; > + case LLVMReadNoneParamAttr: A = ParamAttr::ReadNone; break; > + case LLVMReadOnlyParamAttr: A = ParamAttr::ReadOnly; break; > + } > + Call.setParamAttrs( > + Call.getParamAttrs().addAttr(index, A)); > +} This switch is unnecessary. Just make LLVMParamAttr equivalent to llvm::ParamAttr. > +void LLVMInstrRemoveParamAttr(LLVMValueRef Instr, unsigned index, > LLVMParamAttr Param) { > + > + Instruction *I = unwrap<Instruction>(Instr); > + CallS...
2008 Apr 24
2
[LLVMdev] ParamAttr Patch - Alignment fix
Hi.. Updated so you now set alignment through LLVMInstrSetAlignment. Anders Johnsen -------------- next part -------------- A non-text attachment was scrubbed... Name: ParamAttr.patch Type: text/x-diff Size: 7420 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080424/cb72b4bb/attachment.patch>
2008 Apr 26
2
[LLVMdev] ParamAttr Patch - Alignment fix
...:ByVal; break; > > + case LLVMNestParamAttr: A = ParamAttr::Nest; break; > > + case LLVMReadNoneParamAttr: A = ParamAttr::ReadNone; break; > > + case LLVMReadOnlyParamAttr: A = ParamAttr::ReadOnly; break; > > + } > > + Call.setParamAttrs( > > + Call.getParamAttrs().addAttr(index, A)); > > +} > > This switch is unnecessary. Just make LLVMParamAttr equivalent to > llvm::ParamAttr. > > > +void LLVMInstrRemoveParamAttr(LLVMValueRef Instr, unsigned index, > > LLVMParamAttr Param) { > > + > > + Instruction *I = unwrap&l...
2008 Apr 26
2
[LLVMdev] ParamAttr Patch - Alignment fix
...gnmentFromInt(align)); > > +} > > + > > ... > > > +void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, > > unsigned align) { > > + CallSite Call = CallSite(unwrap<Instruction>(Instr)); > > + Call.setParamAttrs( > > + Call.getParamAttrs().addAttr(index, > > + ParamAttr::constructAlignmentFromInt(align))); > > +} > > + > > If I call this twice with different values, don't I get the bitwise OR > of the two constructAlignmentFromInt values? Does PAListPtr provide a > better API for this? You...
2008 Feb 19
1
[LLVMdev] llc: assertion fails in bitreader.cpp
...>short addtest(short a, short b) >{ > return a+b; >} When I'm feeding llc (llvm-2.1-version) with the resulting bytecode, it fails with this error: llc: BitcodeReader.cpp:1040: bool llvm::BitcodeReader::ParseModule(const std::string&): Assertion `Func->getFunctionType()->getParamAttrs() == getParamAttrs(Record[4])' failed. Has anyone ever experienced something similar? Thanks in advance! Matthias -- GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS. Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
2008 Apr 26
0
[LLVMdev] ParamAttr Patch - Alignment fix
..., at 17:41, Anders Johnsen wrote: >> >> >>> +void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, >>> unsigned align) { >>> + CallSite Call = CallSite(unwrap<Instruction>(Instr)); >>> + Call.setParamAttrs( >>> + Call.getParamAttrs().addAttr(index, >>> + ParamAttr::constructAlignmentFromInt(align))); >>> +} >> >> If I call this twice with different values, don't I get the bitwise >> OR of the two constructAlignmentFromInt values? Does PAListPtr >> provide a better API...
2008 Sep 13
3
[LLVMdev] Duplicate Function with duplicated Arguments
I'm now writing a pass and I wanna ask a question about how to duplicate the function and add duplicated arguments in llvm, for example: func(int a, char *b) -> func(int a, char *b, int a1, char *b1) I'm now stuck at using "getOrInsertFunction" and how to handle "getArgumentList", please share your opinion, thanks a lot! James
2008 Apr 26
0
[LLVMdev] ParamAttr Patch - Alignment fix
...addAttr( > + ParamAttr::constructAlignmentFromInt(align)); > +} > + ... > +void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, > unsigned align) { > + CallSite Call = CallSite(unwrap<Instruction>(Instr)); > + Call.setParamAttrs( > + Call.getParamAttrs().addAttr(index, > + ParamAttr::constructAlignmentFromInt(align))); > +} > + If I call this twice with different values, don't I get the bitwise OR of the two constructAlignmentFromInt values? Does PAListPtr provide a better API for this? Thanks Anders! — Gordon
2011 Sep 16
2
[LLVMdev] How to duplicate a function?
...= dyn_cast<InvokeInst>(Call) ) { New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(), Args, "", Before); cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv()); // cast<InvokeInst>(New)->setParamAttrs(CS.getParamAttrs()); cast<InvokeInst>(New)->setAttributes(CS.getAttributes()); } else { New = CallInst::Create(NF, Args, "", Before); cast<CallInst>(New)->setCallingConv(CS.getCallingConv()); // cast<CallInst>(New)->setParamA...
2011 Sep 16
0
[LLVMdev] How to duplicate a function?
...= dyn_cast<InvokeInst>(Call) ) { New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(), Args, "", Before); cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv()); // cast<InvokeInst>(New)->setParamAttrs(CS.getParamAttrs()); cast<InvokeInst>(New)->setAttributes(CS.getAttributes()); } else { New = CallInst::Create(NF, Args, "", Before); cast<CallInst>(New)->setCallingConv(CS.getCallingConv()); // cast<CallInst>(New)->setParamA...
2008 Apr 28
3
[LLVMdev] ParamAttr Patch - Alignment fix
...:41, Anders Johnsen wrote: > >>> +void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, > >>> unsigned align) { > >>> + CallSite Call = CallSite(unwrap<Instruction>(Instr)); > >>> + Call.setParamAttrs( > >>> + Call.getParamAttrs().addAttr(index, > >>> + ParamAttr::constructAlignmentFromInt(align))); > >>> +} > >> > >> If I call this twice with different values, don't I get the bitwise > >> OR of the two constructAlignmentFromInt values? Does PAListPtr > >...