[LLVMdev] Advice on a VStudio specific patch
Chuck Rose III
cfr at adobe.com
Thu May 31 21:20:20 PDT 2007
Nope, it generates an error, not a warning-as-error. (LLVM generates a whole host of warnings when run through the VStudio STL implementation). I misspoke earlier about VStudio ignoring noreturn. I investigated further and found that the implementation of abort in VStudio 2k5 is not tagged noreturn, hence the error.
Thanks,
Chuck.
-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu on behalf of me22
Sent: Thu 5/31/2007 7:11 PM
To: LLVM Developers Mailing List
Subject: Re: [LLVMdev] Advice on a VStudio specific patch
On 31/05/07, Chuck Rose III <cfr at adobe.com> wrote:
> Here are the two problem areas:
>
> RegisterInfoEmitter.cpp
>
> // Emit the subregister + index mapping function based on the
> information
> // calculated above.
> OS << "unsigned " << ClassName
> << "::getSubReg(unsigned RegNo, unsigned Index) const {\n"
> << " switch (RegNo) {\n"
> << " default: abort(); break;\n";
> ...
> OS << " };\n";
> OS << " return 0; // Visual Studio 2005 does not respect the
> no-return semantics of abort\n";
> OS << "}\n\n";
>
> Need this because otherwise the emitted function will fail to compile in
> VStudio.
>
This might be more subtle than it seems. I'm assuming that since that
actually fails, you have warnings-as-errors on. In compilers with
good flow analysis that do have noreturn abort, the extra return
should trigger an "unreachable code" warning, which will also prevent
compilation with treat warnings as errors on...
I know boost has a BOOST_UNREACHABLE_RETURN(x) macro for that
situation; Perhaps LLVM should have something similar?
~ Scott McMurray
_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list