[llvm] r244381 - AMDGPU: Implement AMDGPUOperand::print()

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 17:41:51 PDT 2015


Author: arsenm
Date: Fri Aug  7 19:41:51 2015
New Revision: 244381

URL: http://llvm.org/viewvc/llvm-project?rev=244381&view=rev
Log:
AMDGPU: Implement AMDGPUOperand::print()

Modified:
    llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp

Modified: llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp?rev=244381&r1=244380&r2=244381&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp Fri Aug  7 19:41:51 2015
@@ -251,7 +251,22 @@ public:
     return EndLoc;
   }
 
-  void print(raw_ostream &OS) const override { }
+  void print(raw_ostream &OS) const override {
+    switch (Kind) {
+    case Register:
+      OS << "<register " << getReg() << '>';
+      break;
+    case Immediate:
+      OS << getImm();
+      break;
+    case Token:
+      OS << '\'' << getToken() << '\'';
+      break;
+    case Expression:
+      OS << "<expr " << *Expr << '>';
+      break;
+    }
+  }
 
   static std::unique_ptr<AMDGPUOperand> CreateImm(int64_t Val, SMLoc Loc,
                                                   enum ImmTy Type = ImmTyNone,




More information about the llvm-commits mailing list