[llvm] r273446 - [codeview] Fix trivial bug in OneMethodRecord::isIntroducingVirtual
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 22 10:32:59 PDT 2016
Author: rnk
Date: Wed Jun 22 12:32:59 2016
New Revision: 273446
URL: http://llvm.org/viewvc/llvm-project?rev=273446&view=rev
Log:
[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.
Modified:
llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h?rev=273446&r1=273445&r2=273446&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h Wed Jun 22 12:32:59 2016
@@ -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:
More information about the llvm-commits
mailing list