[llvm] ecd52a5 - [Verifier] Try to fix MSVC build

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 20 09:47:32 PDT 2021


Author: Nikita Popov
Date: 2021-09-20T18:47:25+02:00
New Revision: ecd52a5be9a1c9c0efe5a1d92aa2cde807758cac

URL: https://github.com/llvm/llvm-project/commit/ecd52a5be9a1c9c0efe5a1d92aa2cde807758cac
DIFF: https://github.com/llvm/llvm-project/commit/ecd52a5be9a1c9c0efe5a1d92aa2cde807758cac.diff

LOG: [Verifier] Try to fix MSVC build

Some buildbots fail with:

> C:\a\llvm-clang-x86_64-expensive-checks-win\llvm-project\llvm\lib\IR\Verifier.cpp(4352): error C2678: binary '==': no operator found which takes a left-hand operand of type 'const llvm::MDOperand' (or there is no acceptable conversion)

Possibly the explicit MDOperand to Metadata* conversion will help?

Added: 
    

Modified: 
    llvm/lib/IR/Verifier.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 4c235d7c7c5d..2aa76b7e7e3c 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -4349,7 +4349,7 @@ void Verifier::visitAliasScopeMetadata(const MDNode *MD) {
   unsigned NumOps = MD->getNumOperands();
   Assert(NumOps >= 2 && NumOps <= 3, "scope must have two or three operands",
          MD);
-  Assert(MD->getOperand(0) == MD || isa<MDString>(MD->getOperand(0)),
+  Assert(MD->getOperand(0).get() == MD || isa<MDString>(MD->getOperand(0)),
          "first scope operand must be self-referential or string", MD);
   if (NumOps == 3)
     Assert(isa<MDString>(MD->getOperand(2)),
@@ -4361,7 +4361,7 @@ void Verifier::visitAliasScopeMetadata(const MDNode *MD) {
   unsigned NumDomainOps = Domain->getNumOperands();
   Assert(NumDomainOps >= 1 && NumDomainOps <= 2,
          "domain must have one or two operands", Domain);
-  Assert(Domain->getOperand(0) == Domain ||
+  Assert(Domain->getOperand(0).get() == Domain ||
              isa<MDString>(Domain->getOperand(0)),
          "first domain operand must be self-referential or string", Domain);
   if (NumDomainOps == 2)


        


More information about the llvm-commits mailing list