Mercurial > projects > ldc
diff ir/irfunction.cpp @ 584:c7d7e2282ba3
Make sure functions containing inline asm are never inlined to avoid
duplicated labels.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Mon, 08 Sep 2008 20:38:55 +0200 |
parents | a34078905d01 |
children | df196c8dea26 |
line wrap: on
line diff
--- a/ir/irfunction.cpp Sun Sep 07 17:44:25 2008 -0700 +++ b/ir/irfunction.cpp Mon Sep 08 20:38:55 2008 +0200 @@ -63,3 +63,17 @@ 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); +}