From: Chris Lattner Date: Sun, 10 Aug 2003 19:50:32 +0000 (+0000) Subject: Add new function X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b72fb7ef75862269879ecaaf8e31c5d9a6bb56e5;p=oota-llvm.git Add new function git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7706 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/support/tools/TableGen/CodeGenWrappers.cpp b/support/tools/TableGen/CodeGenWrappers.cpp index 93e1856c327..61c3abc2971 100644 --- a/support/tools/TableGen/CodeGenWrappers.cpp +++ b/support/tools/TableGen/CodeGenWrappers.cpp @@ -34,6 +34,24 @@ std::string getName(MVT::ValueType T) { } } +std::string getEnumName(MVT::ValueType T) { + switch (T) { + case MVT::Other: return "Other"; + case MVT::i1: return "i1"; + case MVT::i8: return "i8"; + case MVT::i16: return "i16"; + case MVT::i32: return "i32"; + case MVT::i64: return "i64"; + case MVT::i128: return "i128"; + case MVT::f32: return "f32"; + case MVT::f64: return "f64"; + case MVT::f80: return "f80"; + case MVT::f128: return "f128"; + case MVT::isVoid:return "isVoid"; + default: assert(0 && "ILLEGAL VALUE TYPE!"); return ""; + } +} + std::ostream &operator<<(std::ostream &OS, MVT::ValueType T) { return OS << getName(T); diff --git a/support/tools/TableGen/CodeGenWrappers.h b/support/tools/TableGen/CodeGenWrappers.h index ebae8dcf900..595542a24ad 100644 --- a/support/tools/TableGen/CodeGenWrappers.h +++ b/support/tools/TableGen/CodeGenWrappers.h @@ -22,6 +22,7 @@ MVT::ValueType getValueType(Record *Rec); std::ostream &operator<<(std::ostream &OS, MVT::ValueType T); std::string getName(MVT::ValueType T); +std::string getEnumName(MVT::ValueType T); /// CodeGenTarget - This class corresponds to the Target class in the .td files. diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp index 93e1856c327..61c3abc2971 100644 --- a/utils/TableGen/CodeGenTarget.cpp +++ b/utils/TableGen/CodeGenTarget.cpp @@ -34,6 +34,24 @@ std::string getName(MVT::ValueType T) { } } +std::string getEnumName(MVT::ValueType T) { + switch (T) { + case MVT::Other: return "Other"; + case MVT::i1: return "i1"; + case MVT::i8: return "i8"; + case MVT::i16: return "i16"; + case MVT::i32: return "i32"; + case MVT::i64: return "i64"; + case MVT::i128: return "i128"; + case MVT::f32: return "f32"; + case MVT::f64: return "f64"; + case MVT::f80: return "f80"; + case MVT::f128: return "f128"; + case MVT::isVoid:return "isVoid"; + default: assert(0 && "ILLEGAL VALUE TYPE!"); return ""; + } +} + std::ostream &operator<<(std::ostream &OS, MVT::ValueType T) { return OS << getName(T); diff --git a/utils/TableGen/CodeGenTarget.h b/utils/TableGen/CodeGenTarget.h index ebae8dcf900..595542a24ad 100644 --- a/utils/TableGen/CodeGenTarget.h +++ b/utils/TableGen/CodeGenTarget.h @@ -22,6 +22,7 @@ MVT::ValueType getValueType(Record *Rec); std::ostream &operator<<(std::ostream &OS, MVT::ValueType T); std::string getName(MVT::ValueType T); +std::string getEnumName(MVT::ValueType T); /// CodeGenTarget - This class corresponds to the Target class in the .td files. diff --git a/utils/TableGen/CodeGenWrappers.cpp b/utils/TableGen/CodeGenWrappers.cpp index 93e1856c327..61c3abc2971 100644 --- a/utils/TableGen/CodeGenWrappers.cpp +++ b/utils/TableGen/CodeGenWrappers.cpp @@ -34,6 +34,24 @@ std::string getName(MVT::ValueType T) { } } +std::string getEnumName(MVT::ValueType T) { + switch (T) { + case MVT::Other: return "Other"; + case MVT::i1: return "i1"; + case MVT::i8: return "i8"; + case MVT::i16: return "i16"; + case MVT::i32: return "i32"; + case MVT::i64: return "i64"; + case MVT::i128: return "i128"; + case MVT::f32: return "f32"; + case MVT::f64: return "f64"; + case MVT::f80: return "f80"; + case MVT::f128: return "f128"; + case MVT::isVoid:return "isVoid"; + default: assert(0 && "ILLEGAL VALUE TYPE!"); return ""; + } +} + std::ostream &operator<<(std::ostream &OS, MVT::ValueType T) { return OS << getName(T); diff --git a/utils/TableGen/CodeGenWrappers.h b/utils/TableGen/CodeGenWrappers.h index ebae8dcf900..595542a24ad 100644 --- a/utils/TableGen/CodeGenWrappers.h +++ b/utils/TableGen/CodeGenWrappers.h @@ -22,6 +22,7 @@ MVT::ValueType getValueType(Record *Rec); std::ostream &operator<<(std::ostream &OS, MVT::ValueType T); std::string getName(MVT::ValueType T); +std::string getEnumName(MVT::ValueType T); /// CodeGenTarget - This class corresponds to the Target class in the .td files.