[PATCH] Don't emit prologues/epilogues for naked functions (PR18791, PR20028)
Reid Kleckner
rnk at google.com
Thu Sep 4 13:34:20 PDT 2014
lgtm
================
Comment at: lib/Sema/SemaStmtAsm.cpp:414
@@ +413,3 @@
+ Diag(Id.getLocStart(), diag::err_asm_naked_parm_ref);
+ Diag(Func->getAttr<NakedAttr>()->getLocation(), diag::note_attribute);
+ }
----------------
thakis wrote:
> Do you need to ` Func->setInvalidDecl();` here too?
Let's do that.
================
Comment at: test/CodeGen/attr-naked.c:21
@@ +20,3 @@
+// CHECK: define void @t3(i32)
+// CHECK-NEXT: entry
+// CHECK-NOT: alloca
----------------
This CHECK will fail in a non-asserts build, because the name 'entry' will be elided. I guess I'd just rely on the CHECK-NOT for alloca and store followed by CHECK unreachable.
http://reviews.llvm.org/D5183
More information about the cfe-commits
mailing list