Add new function
authorChris Lattner <sabre@nondot.org>
Sun, 10 Aug 2003 19:50:32 +0000 (19:50 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 10 Aug 2003 19:50:32 +0000 (19:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7706 91177308-0d34-0410-b5e6-96231b3b80d8

support/tools/TableGen/CodeGenWrappers.cpp
support/tools/TableGen/CodeGenWrappers.h
utils/TableGen/CodeGenTarget.cpp
utils/TableGen/CodeGenTarget.h
utils/TableGen/CodeGenWrappers.cpp
utils/TableGen/CodeGenWrappers.h

index 93e1856c327396e9200254de6ba0b8f5d5ac102a..61c3abc29711a3079d914ce7035a4a18caef81c5 100644 (file)
@@ -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);
index ebae8dcf900a00d798f65d80f0d21a580393c40e..595542a24ad608973cc7d35b38b4fbbb7d366e67 100644 (file)
@@ -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.
index 93e1856c327396e9200254de6ba0b8f5d5ac102a..61c3abc29711a3079d914ce7035a4a18caef81c5 100644 (file)
@@ -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);
index ebae8dcf900a00d798f65d80f0d21a580393c40e..595542a24ad608973cc7d35b38b4fbbb7d366e67 100644 (file)
@@ -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.
index 93e1856c327396e9200254de6ba0b8f5d5ac102a..61c3abc29711a3079d914ce7035a4a18caef81c5 100644 (file)
@@ -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);
index ebae8dcf900a00d798f65d80f0d21a580393c40e..595542a24ad608973cc7d35b38b4fbbb7d366e67 100644 (file)
@@ -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.