From b0625ca0748476899ee814ece1706f2fef85b60c Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 22 Jun 2016 17:32:59 +0000 Subject: [PATCH] [codeview] Fix trivial bug in OneMethodRecord::isIntroducingVirtual 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 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/llvm/DebugInfo/CodeView/TypeRecord.h b/include/llvm/DebugInfo/CodeView/TypeRecord.h index 1ec05292c3d..1a6f82fdcd2 100644 --- a/include/llvm/DebugInfo/CodeView/TypeRecord.h +++ b/include/llvm/DebugInfo/CodeView/TypeRecord.h @@ -904,10 +904,8 @@ public: StringRef getName() const { return Name; } bool isIntroducingVirtual() const { - const uint8_t K = static_cast(Kind); - const uint8_t V = static_cast(MethodKind::IntroducingVirtual); - const uint8_t PV = static_cast(MethodKind::PureIntroducingVirtual); - return (K & V) || (K & PV); + return Kind == MethodKind::IntroducingVirtual || + Kind == MethodKind::PureIntroducingVirtual; } private: -- 2.50.1