[cfe-commits] r171768 - /cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp

Dmitri Gribenko gribozavr at gmail.com
Mon Jan 7 11:19:17 PST 2013


On Mon, Jan 7, 2013 at 9:09 PM, Alexander Kornienko <alexfh at google.com> wrote:
> Author: alexfh
> Date: Mon Jan  7 13:09:15 2013
> New Revision: 171768
>
> URL: http://llvm.org/viewvc/llvm-project?rev=171768&view=rev
> Log:
> Fixed a number of -Wcovered-switch-default diagnostics in tools/clang/include/clang/AST/AttrDump.inc
>
> Modified:
>     cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp
>
> Modified: cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?rev=171768&r1=171767&r2=171768&view=diff
> ==============================================================================
> --- cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp (original)
> +++ cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp Mon Jan  7 13:09:15 2013
> @@ -549,11 +549,6 @@
>      }
>      void writeDump(raw_ostream &OS) const {
>        OS << "    switch(SA->get" << getUpperName() << "()) {\n";
> -      OS << "    default:\n";
> -      OS << "      llvm_unreachable(\"Unknown " << getAttrName() << "Attr::"
> -         << type << "!\");\n";
> -      OS << "      break;\n";
> -
>        for (std::vector<StringRef>::const_iterator I = uniques.begin(),
>             E = uniques.end(); I != E; ++I) {
>          OS << "    case " << getAttrName() << "Attr::" << *I << ":\n";

"break" can be replaced "return" in the switch, then we can put the
llvm_unreachable() after the switch().

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list