Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Commit

Permalink
Fix function attribute LLVM API usage
Browse files Browse the repository at this point in the history
AFAICT, we don't need the index attributes so just use
Function::addFnAttr() API directly.

Signed-off-by: Pekka Enberg <penberg@iki.fi>
  • Loading branch information
penberg committed Jan 8, 2014
1 parent 5a7d0c9 commit 7988741
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions libcpu/function.cpp
Expand Up @@ -324,17 +324,8 @@ cpu_create_function(cpu_t *cpu, const char *name,
GlobalValue::ExternalLinkage, /* Linkage */
name, cpu->mod); /* Name */
func->setCallingConv(CallingConv::C);
AttrListPtr func_PAL;
{
SmallVector<AttributeWithIndex, 4> Attrs;
AttributeWithIndex PAWI;
PAWI.Index = 1U; PAWI.Attrs = 0 | Attribute::NoCapture;
Attrs.push_back(PAWI);
PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
Attrs.push_back(PAWI);
func_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
}
func->setAttributes(func_PAL);
func->addFnAttr(Attribute::NoCapture);
func->addFnAttr(Attribute::NoUnwind);

// args
Function::arg_iterator args = func->arg_begin();
Expand Down

0 comments on commit 7988741

Please sign in to comment.