[cfe-commits] r140142 - in /cfe/trunk/lib: AST/Decl.cpp Sema/SemaDecl.cpp
Peter Collingbourne
peter at pcc.me.uk
Tue Sep 20 05:40:26 PDT 2011
Author: pcc
Date: Tue Sep 20 07:40:26 2011
New Revision: 140142
URL: http://llvm.org/viewvc/llvm-project?rev=140142&view=rev
Log:
Remove redundant break statements, and replace asserts with llvm_unreachable
Per John's review comments for r140068.
Modified:
cfe/trunk/lib/AST/Decl.cpp
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=140142&r1=140141&r2=140142&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Tue Sep 20 07:40:26 2011
@@ -1120,15 +1120,15 @@
const char *VarDecl::getStorageClassSpecifierString(StorageClass SC) {
switch (SC) {
case SC_None: break;
- case SC_Auto: return "auto"; break;
- case SC_Extern: return "extern"; break;
- case SC_OpenCLWorkGroupLocal: return "<<work-group-local>>"; break;
- case SC_PrivateExtern: return "__private_extern__"; break;
- case SC_Register: return "register"; break;
- case SC_Static: return "static"; break;
+ case SC_Auto: return "auto";
+ case SC_Extern: return "extern";
+ case SC_OpenCLWorkGroupLocal: return "<<work-group-local>>";
+ case SC_PrivateExtern: return "__private_extern__";
+ case SC_Register: return "register";
+ case SC_Static: return "static";
}
- assert(0 && "Invalid storage class");
+ llvm_unreachable("Invalid storage class");
return 0;
}
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=140142&r1=140141&r2=140142&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Sep 20 07:40:26 2011
@@ -6148,8 +6148,7 @@
Error = 4;
break;
case SC_OpenCLWorkGroupLocal:
- assert(0 && "Unexpected storage class");
- break;
+ llvm_unreachable("Unexpected storage class");
}
// FIXME: constexpr isn't allowed here.
//if (DS.isConstexprSpecified())
More information about the cfe-commits
mailing list