Update clang to r339409b.
Change-Id: Ied8a188bb072c40035320acedc86164b66d920af
diff --git a/linux-x64/clang/include/llvm/IR/Operator.h b/linux-x64/clang/include/llvm/IR/Operator.h
index 939cec7..6b387bb 100644
--- a/linux-x64/clang/include/llvm/IR/Operator.h
+++ b/linux-x64/clang/include/llvm/IR/Operator.h
@@ -364,19 +364,26 @@
/// precision.
float getFPAccuracy() const;
- static bool classof(const Instruction *I) {
- return I->getType()->isFPOrFPVectorTy() ||
- I->getOpcode() == Instruction::FCmp;
- }
-
- static bool classof(const ConstantExpr *CE) {
- return CE->getType()->isFPOrFPVectorTy() ||
- CE->getOpcode() == Instruction::FCmp;
- }
-
static bool classof(const Value *V) {
- return (isa<Instruction>(V) && classof(cast<Instruction>(V))) ||
- (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V)));
+ unsigned Opcode;
+ if (auto *I = dyn_cast<Instruction>(V))
+ Opcode = I->getOpcode();
+ else if (auto *CE = dyn_cast<ConstantExpr>(V))
+ Opcode = CE->getOpcode();
+ else
+ return false;
+
+ switch (Opcode) {
+ case Instruction::FCmp:
+ return true;
+ // non math FP Operators (no FMF)
+ case Instruction::ExtractElement:
+ case Instruction::ShuffleVector:
+ case Instruction::InsertElement:
+ return false;
+ default:
+ return V->getType()->isFPOrFPVectorTy();
+ }
}
};