search for: setparamattr

Displaying 12 results from an estimated 12 matches for "setparamattr".

Did you mean: setparamattrs
2008 Apr 26
0
[LLVMdev] ParamAttr Patch - Alignment fix
...et; break; > + case LLVMByValParamAttr: 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<Instruc...
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
...LLVMByValParamAttr: 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) { > > + &gt...
2008 Apr 26
2
[LLVMdev] ParamAttr Patch - Alignment fix
...+ 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 provi...
2008 Apr 26
0
[LLVMdev] ParamAttr Patch - Alignment fix
...n wrote: > >> On Apr 26, 2008, 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 PALi...
2008 Oct 18
2
[LLVMdev] Is the online demo using outdated binaries?
...ndex PAWI; PAWI.index = 0; PAWI.attrs = 0 | ParamAttr::NoUnwind; Attrs.push_back(PAWI); PAWI.index = 1; PAWI.attrs = 0 | ParamAttr::StructRet | ParamAttr::NoAlias; Attrs.push_back(PAWI); func__Z3foov_PAL = PAListPtr::get(Attrs.begin(), Attrs.end()); } func__Z3foov->setParamAttrs(func__Z3foov_PAL); (...) Please note that it uses index 1 for the return attributes, which is inconsistent with what ReleaseNotes.html TOT says: ... * Return value attributes are stored at index 0. Function attributes are stored at index ~0U. Parameter attributes are stored at index that matches...
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
...wrap<Argument>(Arg)->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? Tha...
2011 Sep 16
2
[LLVMdev] How to duplicate a function?
...( InvokeInst *II = 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>(N...
2011 Sep 16
0
[LLVMdev] How to duplicate a function?
...( InvokeInst *II = 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>(N...
2008 Oct 18
0
[LLVMdev] Is the online demo using outdated binaries?
...PAWI.attrs = 0 | ParamAttr::NoUnwind; > Attrs.push_back(PAWI); > PAWI.index = 1; PAWI.attrs = 0 | ParamAttr::StructRet | > ParamAttr::NoAlias; > Attrs.push_back(PAWI); > func__Z3foov_PAL = PAListPtr::get(Attrs.begin(), Attrs.end()); > > } > func__Z3foov->setParamAttrs(func__Z3foov_PAL); > (...) > > Please note that it uses index 1 for the return attributes, which is > inconsistent with what ReleaseNotes.html TOT says: > > ... > * Return value attributes are stored at index 0. Function attributes > are > stored at index ~0U. Paramete...
2008 Apr 28
3
[LLVMdev] ParamAttr Patch - Alignment fix
...wrote: > >> On Apr 26, 2008, 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 constructAlignm...