[llvm-commits] [llvm] r157523 - /llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp

Chris Lattner sabre at nondot.org
Sat May 26 16:03:52 PDT 2012


Author: lattner
Date: Sat May 26 18:03:52 2012
New Revision: 157523

URL: http://llvm.org/viewvc/llvm-project?rev=157523&view=rev
Log:
rearrange some code, no functionality change.

Modified:
    llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp

Modified: llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp?rev=157523&r1=157522&r2=157523&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp Sat May 26 18:03:52 2012
@@ -389,12 +389,31 @@
   
   MVT::SimpleValueType VT = getValueType(R->getValueAsDef("VT"));
 
-  // If this is an "any" valuetype, then the type is the type of the next
-  // type in the list specified to getIntrinsic().  
-  if (VT == MVT::iAny || VT == MVT::fAny || VT == MVT::vAny ||
-      VT == MVT::iPTRAny) {
+  switch (VT) {
+  default: break;
+  case MVT::iAny:
+  case MVT::fAny:
+  case MVT::vAny:
+  case MVT::iPTRAny:
+    // If this is an "any" valuetype, then the type is the type of the next
+    // type in the list specified to getIntrinsic().  
     Sig.push_back(IIT_ARG);
     return Sig.push_back(NextArgNo++);
+  
+  case MVT::iPTR: {
+    unsigned AddrSpace = 0;
+    if (R->isSubClassOf("LLVMQualPointerType")) {
+      AddrSpace = R->getValueAsInt("AddrSpace");
+      assert(AddrSpace < 256 && "Address space exceeds 255");
+    }
+    if (AddrSpace) {
+      Sig.push_back(IIT_ANYPTR);
+      Sig.push_back(AddrSpace);
+    } else {
+      Sig.push_back(IIT_PTR);
+    }
+    return EncodeFixedType(R->getValueAsDef("ElTy"), NextArgNo, Sig);
+  }
   }
   
   if (EVT(VT).isVector()) {
@@ -411,22 +430,7 @@
     return EncodeFixedValueType(VVT.getVectorElementType().
                                 getSimpleVT().SimpleTy, Sig);
   }
-  
-  if (VT == MVT::iPTR) {
-    unsigned AddrSpace = 0;
-    if (R->isSubClassOf("LLVMQualPointerType")) {
-      AddrSpace = R->getValueAsInt("AddrSpace");
-      assert(AddrSpace < 256 && "Address space exceeds 255");
-    }
-    if (AddrSpace) {
-      Sig.push_back(IIT_ANYPTR);
-      Sig.push_back(AddrSpace);
-    } else {
-      Sig.push_back(IIT_PTR);
-    }
-    return EncodeFixedType(R->getValueAsDef("ElTy"), NextArgNo, Sig);
-  }
-  
+
   EncodeFixedValueType(VT, Sig);
 }
 





More information about the llvm-commits mailing list