]> granicus.if.org Git - llvm/commitdiff
[codeview] Fix trivial bug in OneMethodRecord::isIntroducingVirtual
authorReid Kleckner <rnk@google.com>
Wed, 22 Jun 2016 17:32:59 +0000 (17:32 +0000)
committerReid Kleckner <rnk@google.com>
Wed, 22 Jun 2016 17:32:59 +0000 (17:32 +0000)
These should be equality comparisons. Fixes assertions while
self-hosting clang with codeview debug info.

Ultimately this is going to be covered by real tests for virtual method
emission, so I'm not adding a "don't crash on this input" test that I'll
remove soon afterwards.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273446 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/DebugInfo/CodeView/TypeRecord.h

index 1ec05292c3d60ae63d53f1a733cfad604b735aa8..1a6f82fdcd2433da2f084f0d1428f4467a82dbf3 100644 (file)
@@ -904,10 +904,8 @@ public:
   StringRef getName() const { return Name; }
 
   bool isIntroducingVirtual() const {
-    const uint8_t K = static_cast<uint8_t>(Kind);
-    const uint8_t V = static_cast<uint8_t>(MethodKind::IntroducingVirtual);
-    const uint8_t PV = static_cast<uint8_t>(MethodKind::PureIntroducingVirtual);
-    return (K & V) || (K & PV);
+    return Kind == MethodKind::IntroducingVirtual ||
+           Kind == MethodKind::PureIntroducingVirtual;
   }
 
 private: