copyFastMathFlags utility and test case
[oota-llvm.git] / lib / VMCore / Instruction.cpp
index d93c1d7a22c04b26ca75d53265a89b8597429558..7b73e770fb3dbfe6fce6009b2a32b62a95b0f835 100644 (file)
@@ -177,6 +177,12 @@ FastMathFlags Instruction::getFastMathFlags() const {
   return cast<FPMathOperator>(this)->getFastMathFlags();
 }
 
+/// Copy I's fast-math flags
+void Instruction::copyFastMathFlags(const Instruction *I) {
+  setFastMathFlags(I->getFastMathFlags());
+}
+
+
 const char *Instruction::getOpcodeName(unsigned OpCode) {
   switch (OpCode) {
   // Terminators