r200140 - Fix -Wreturn-type build failure on ASTMatchers, plus an intended assert

Alp Toker alp at nuanti.com
Sun Jan 26 00:12:32 PST 2014


Author: alp
Date: Sun Jan 26 02:12:32 2014
New Revision: 200140

URL: http://llvm.org/viewvc/llvm-project?rev=200140&view=rev
Log:
Fix -Wreturn-type build failure on ASTMatchers, plus an intended assert

Modified:
    cfe/trunk/lib/ASTMatchers/Dynamic/Marshallers.h
    cfe/trunk/lib/Basic/Diagnostic.cpp

Modified: cfe/trunk/lib/ASTMatchers/Dynamic/Marshallers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ASTMatchers/Dynamic/Marshallers.h?rev=200140&r1=200139&r2=200140&view=diff
==============================================================================
--- cfe/trunk/lib/ASTMatchers/Dynamic/Marshallers.h (original)
+++ cfe/trunk/lib/ASTMatchers/Dynamic/Marshallers.h Sun Jan 26 02:12:32 2014
@@ -54,6 +54,7 @@ struct ArgKind {
     case AK_String:
       return "string";
     }
+    llvm_unreachable("unhandled ArgKind");
   }
 
   Kind getArgKind() const { return K; }

Modified: cfe/trunk/lib/Basic/Diagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Diagnostic.cpp?rev=200140&r1=200139&r2=200140&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Diagnostic.cpp (original)
+++ cfe/trunk/lib/Basic/Diagnostic.cpp Sun Jan 26 02:12:32 2014
@@ -222,7 +222,7 @@ void DiagnosticsEngine::setDiagnosticMap
 
   // Create a new state/point and fit it into the vector of DiagStatePoints
   // so that the vector is always ordered according to location.
-  Pos->Loc.isBeforeInTranslationUnitThan(Loc);
+  assert(Pos->Loc.isBeforeInTranslationUnitThan(Loc));
   DiagStates.push_back(*Pos->State);
   DiagState *NewState = &DiagStates.back();
   GetCurDiagState()->setMappingInfo(Diag, MappingInfo);





More information about the cfe-commits mailing list