stage2: implement noinline fn

This commit is contained in:
Meghan
2022-07-24 01:56:33 -07:00
committed by GitHub
parent 903bed931d
commit dea437edfb
7 changed files with 47 additions and 7 deletions

View File

@@ -699,6 +699,12 @@ pub const Object = struct {
DeclGen.removeFnAttr(llvm_func, "cold");
}
if (func.is_noinline) {
dg.addFnAttr(llvm_func, "noinline");
} else {
DeclGen.removeFnAttr(llvm_func, "noinline");
}
// Remove all the basic blocks of a function in order to start over, generating
// LLVM IR from an empty function body.
while (llvm_func.getFirstBasicBlock()) |bb| {