[llvm-commits] [PATCH] Marking functions which do not return as LLVM_ATTRIBUTE_NORETURN

Joe Abbey joe.abbey at gmail.com
Mon Nov 19 14:08:59 PST 2012


The compiler I'm using has emitted a "control flow reaches end of non-void function warning"  in CodeGenInstruction.cpp.  The last line of ParseOperandName calls PrintFatalError.   I was hoping that by marking it as noreturn the compiler would no longer emit this warning.  I've just tested it on that host and it doesn't seem to be the case.  

There's still some advantage to marking these functions as noreturn as code gen can be a little more aggressive with call-sites to non-returning functions.

Digging deeper to attempt to alleviate the warning... it's not critical.

Joe

On Nov 19, 2012, at 4:57 PM, Sean Silva <silvas at purdue.edu> wrote:

> Could you give a bit more context? Were these causing build warnings?
> What was the motivation for the patch?
> 
> -- Sean Silva
> 
> On Mon, Nov 19, 2012 at 4:51 PM, Joe Abbey <jabbey at arxan.com> wrote:
>> Attached patch marks a couple TableGen error functions  and
>> SubtargetFeature's help as LLVM_ATTRIBUTE_NORETURN.
>> 
>> Ok to commit?
>> 
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list