diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2018-10-02 23:44:11 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2018-10-02 23:44:11 +0000 |
commit | b02ba99e91ed89124401d2b9113a1cfa54fa76d9 (patch) | |
tree | 626ac2ad26ec0acc214de40eecf31f64e05b284f /llvm/lib/IR/AsmWriter.cpp | |
parent | abcacf9753e3ae0bd5aa6a7fb476ef1f3328fe50 (diff) | |
download | bcm5719-llvm-b02ba99e91ed89124401d2b9113a1cfa54fa76d9.tar.gz bcm5719-llvm-b02ba99e91ed89124401d2b9113a1cfa54fa76d9.zip |
IR: Move AtomicRMW string names into class
This will be used to improve error messages in a future commit.
llvm-svn: 343647
Diffstat (limited to 'llvm/lib/IR/AsmWriter.cpp')
-rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 7f3a6bee6b9..33863da468d 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -1241,24 +1241,6 @@ static void WriteAsOperandInternal(raw_ostream &Out, const Metadata *MD, SlotTracker *Machine, const Module *Context, bool FromValue = false); -static void writeAtomicRMWOperation(raw_ostream &Out, - AtomicRMWInst::BinOp Op) { - switch (Op) { - default: Out << " <unknown operation " << Op << ">"; break; - case AtomicRMWInst::Xchg: Out << " xchg"; break; - case AtomicRMWInst::Add: Out << " add"; break; - case AtomicRMWInst::Sub: Out << " sub"; break; - case AtomicRMWInst::And: Out << " and"; break; - case AtomicRMWInst::Nand: Out << " nand"; break; - case AtomicRMWInst::Or: Out << " or"; break; - case AtomicRMWInst::Xor: Out << " xor"; break; - case AtomicRMWInst::Max: Out << " max"; break; - case AtomicRMWInst::Min: Out << " min"; break; - case AtomicRMWInst::UMax: Out << " umax"; break; - case AtomicRMWInst::UMin: Out << " umin"; break; - } -} - static void WriteOptimizationInfo(raw_ostream &Out, const User *U) { if (const FPMathOperator *FPO = dyn_cast<const FPMathOperator>(U)) { // 'Fast' is an abbreviation for all fast-math-flags. @@ -3612,7 +3594,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) { // Print out the atomicrmw operation if (const AtomicRMWInst *RMWI = dyn_cast<AtomicRMWInst>(&I)) - writeAtomicRMWOperation(Out, RMWI->getOperation()); + Out << ' ' << AtomicRMWInst::getOperationName(RMWI->getOperation()); // Print out the type of the operands... const Value *Operand = I.getNumOperands() ? I.getOperand(0) : nullptr; |