Make sure functions containing inline asm are never inlined to avoid

duplicated labels.
This commit is contained in:
Christian Kamm
2008-09-08 20:38:55 +02:00
parent f411df11e3
commit 4e0b6b4bf0
3 changed files with 21 additions and 0 deletions

View File

@@ -63,3 +63,17 @@ void IrFunction::popLabelScope()
labelScopes.pop_back();
nextUnique.pop();
}
void IrFunction::setNeverInline()
{
llvm::FunctionNotes cur = func->getNotes();
assert(!(cur & llvm::FN_NOTE_AlwaysInline) && "function can't be never- and always-inline at the same time");
func->setNotes(cur | llvm::FN_NOTE_NoInline);
}
void IrFunction::setAlwaysInline()
{
llvm::FunctionNotes cur = func->getNotes();
assert(!(cur & llvm::FN_NOTE_NoInline) && "function can't be never- and always-inline at the same time");
func->setNotes(cur | llvm::FN_NOTE_AlwaysInline);
}