Re: [PATCH] D24193: Allow variables with asm labels in naked functions

2016-09-13 Thread Nikola Smiljanić via cfe-commits
nikola closed this revision. nikola added a comment. r281298 https://reviews.llvm.org/D24193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D24193: Allow variables with asm labels in naked functions

2016-09-12 Thread Hans Wennborg via cfe-commits
hans accepted this revision. hans added a comment. This revision is now accepted and ready to land. lgtm I'm a little bit worried that we've started down a slippery slope of deciding what is and isn't allowed in naked functions (for example, some initializers could be allowed if we're sure

Re: [PATCH] D24193: Allow variables with asm labels in naked functions

2016-09-12 Thread Nikola Smiljanić via cfe-commits
nikola updated this revision to Diff 70985. nikola added a comment. This should address Hans' comments, as for the code get I have no idea. I was hoping someone more knowledgeable would tell me if this made sense or not? https://reviews.llvm.org/D24193 Files: lib/Sema/SemaDecl.cpp

Re: [PATCH] D24193: Allow variables with asm labels in naked functions

2016-09-02 Thread Reid Kleckner via cfe-commits
rnk added a comment. Won't the mid-level optimizer turn these register variables into undefs, and we'll end up with this kind of IR? void f() { int register var asm ("eax") ; asm volatile ("add %%eax, %0\n\tret" : : "r"(var)); } -> define void @"\01?f@@YAXXZ"()

Re: [PATCH] D24193: Allow variables with asm labels in naked functions

2016-09-02 Thread Hans Wennborg via cfe-commits
hans added a comment. I think this is reasonable. Just a few comments: Comment at: lib/Sema/SemaDecl.cpp:11796 @@ +11795,3 @@ +if (auto *DS = dyn_cast(S)) { + if (DS->isSingleDecl()) { +if (auto *Var = dyn_cast_or_null(DS->getSingleDecl())) {

[PATCH] D24193: Allow variables with asm labels in naked functions

2016-09-02 Thread Nikola Smiljanić via cfe-commits
nikola created this revision. nikola added reviewers: hans, rnk, compnerd. nikola added a subscriber: cfe-commits. Herald added a subscriber: aemerson. I think the current mode is too restrictive, it will emit error for any statement inside a naked function. Code I'm trying to compile for ARM