Change Path::filename_pos() to skip the drive letter.
[oota-llvm.git] / lib / IR / Verifier.cpp
index 3db73f5573959068918a817684411147a0615ad5..5d4de30e44013a01d94ae723efdfc5ae27b1b42a 100644 (file)
@@ -680,9 +680,8 @@ void Verifier::visitMetadataAsValue(const MetadataAsValue &MDV, Function *F) {
 
 void Verifier::visitMDLocation(const MDLocation &N) {
   Assert1(N.getScope(), "location requires a valid scope", &N);
-  if (N.getInlinedAt())
-    Assert2(isa<MDLocation>(N.getInlinedAt()),
-            "inlined-at should be a location", &N, N.getInlinedAt());
+  if (auto *IA = N.getInlinedAt())
+    Assert2(isa<MDLocation>(IA), "inlined-at should be a location", &N, IA);
 }
 
 void Verifier::visitGenericDebugNode(const GenericDebugNode &N) {
@@ -819,7 +818,7 @@ void Verifier::visitModuleIdents(const Module &M) {
     const MDNode *N = Idents->getOperand(i);
     Assert1(N->getNumOperands() == 1,
             "incorrect number of operands in llvm.ident metadata", N);
-    Assert1(isa<MDString>(N->getOperand(0)),
+    Assert1(dyn_cast_or_null<MDString>(N->getOperand(0)),
             ("invalid value for llvm.ident metadata entry operand"
              "(the operand should be a string)"),
             N->getOperand(0));
@@ -870,7 +869,7 @@ Verifier::visitModuleFlag(const MDNode *Op,
   Module::ModFlagBehavior MFB;
   if (!Module::isValidModFlagBehavior(Op->getOperand(0), MFB)) {
     Assert1(
-        mdconst::dyn_extract<ConstantInt>(Op->getOperand(0)),
+        mdconst::dyn_extract_or_null<ConstantInt>(Op->getOperand(0)),
         "invalid behavior operand in module flag (expected constant integer)",
         Op->getOperand(0));
     Assert1(false,