Add new ValueType for metadata.
authorDevang Patel <dpatel@apple.com>
Mon, 6 Jul 2009 23:44:32 +0000 (23:44 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 6 Jul 2009 23:44:32 +0000 (23:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74882 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/ValueTypes.h
include/llvm/CodeGen/ValueTypes.td
utils/TableGen/CodeGenTarget.cpp
utils/TableGen/IntrinsicEmitter.cpp

index e661c58940e1dc70d461176edd799a21f9926f63..f7e28bebfd6daac254612cb3e8ba41b58c374cc6 100644 (file)
@@ -83,6 +83,9 @@ namespace llvm {
       // This value must be a multiple of 32.
       MAX_ALLOWED_VALUETYPE = 64,
 
+      // Metadata - This is MDNode or MDString. 
+      Metadata       = 251,
+
       // iPTRAny - An int value the size of the pointer of the current
       // target to any address space. This must only be used internal to
       // tblgen. Other than for overloading, we treat iPTRAny the same as iPTR.
index 7f6728bb678e21d133e31a3da2e71636eadf47f2..76829344d24495d7d5ba350d6d1c75f82ca28876 100644 (file)
@@ -57,7 +57,9 @@ def v4f32  : ValueType<128, 32>;   //  4 x f32 vector value
 def v8f32  : ValueType<256, 33>;   //  8 x f32 vector value
 def v2f64  : ValueType<128, 34>;   //  2 x f64 vector value
 def v4f64  : ValueType<256, 35>;   //  4 x f64 vector value
-  
+
+def MetadataVT: ValueType<0, 251>; // Metadata
+
 // Pseudo valuetype mapped to the current pointer size to any address space.
 // Should only be used in TableGen.
 def iPTRAny   : ValueType<0, 252>;
index c17cd0eef2daaba4e0f04a0e6b7dd7556472c529..c449660c4290ecef199e7a0c979c41622deed53a 100644 (file)
@@ -118,6 +118,7 @@ std::string llvm::getEnumName(MVT::SimpleValueType T) {
   case MVT::v4f64: return "MVT::v4f64";
   case MVT::v3i32: return "MVT::v3i32";
   case MVT::v3f32: return "MVT::v3f32";
+  case MVT::Metadata: return "MVT::Metadata";
   case MVT::iPTR:  return "MVT::iPTR";
   case MVT::iPTRAny:  return "MVT::iPTRAny";
   default: assert(0 && "ILLEGAL VALUE TYPE!"); return "";
index 36768316bc0e894c1bff5869b467ce7ab22622f3..f4157bb460997148ba9127ce1dce429bdca2f829 100644 (file)
@@ -159,6 +159,8 @@ static void EmitTypeForValueType(raw_ostream &OS, MVT::SimpleValueType VT) {
     OS << "Type::PPC_FP128Ty";
   } else if (VT == MVT::isVoid) {
     OS << "Type::VoidTy";
+  } else if (VT == MVT::Metadata) {
+    OS << "Type::MetadataTy";
   } else {
     assert(false && "Unsupported ValueType!");
   }