[cfe-commits] r147894 - /cfe/trunk/lib/CodeGen/TargetInfo.cpp

Akira Hatanaka ahatanaka at mips.com
Tue Jan 10 15:30:49 PST 2012


Author: ahatanak
Date: Tue Jan 10 17:30:49 2012
New Revision: 147894

URL: http://llvm.org/viewvc/llvm-project?rev=147894&view=rev
Log:
Remove switch/case statements and call GetFloatingPointTy() instead to get the
floating point type.


Modified:
    cfe/trunk/lib/CodeGen/TargetInfo.cpp

Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=147894&r1=147893&r2=147894&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Tue Jan 10 17:30:49 2012
@@ -3225,19 +3225,7 @@
       if (!BT || !BT->isFloatingPoint())
         break;
 
-      switch (BT->getKind()) {
-      case BuiltinType::Float:
-        RTList.push_back(llvm::Type::getFloatTy(getVMContext()));
-        break;
-      case BuiltinType::Double:
-        RTList.push_back(llvm::Type::getDoubleTy(getVMContext()));
-        break;
-      case BuiltinType::LongDouble:
-        RTList.push_back(llvm::Type::getFP128Ty(getVMContext()));
-        break;
-      default:
-        assert(false && "Unexpexted floating point type.");
-      }
+      RTList.push_back(GetFloatingPointTy(BT));
     }
 
     if (i == e)





More information about the cfe-commits mailing list