Remove exception specification
[oota-llvm.git] / lib / Target / TargetMachine.cpp
index ec264829b166452d4f77b27ac01b2ece3c499315..d508b32a399287a2d09b38dea8d9396948f147d5 100644 (file)
@@ -5,7 +5,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Target/InstInfo.h"
+#include "llvm/Target/MachineInstrInfo.h"
 #include "llvm/DerivedTypes.h"
 
 //---------------------------------------------------------------------------
@@ -16,6 +16,7 @@
 // 
 //---------------------------------------------------------------------------
 
+
 // function TargetMachine::findOptimalStorageSize 
 // 
 // Purpose:
 //   space equal to optSizeForSubWordData, and all other primitive data
 //   items use space according to the type.
 //   
-unsigned int TargetMachine::findOptimalStorageSize(const Type* ty) const {
-  switch(ty->getPrimitiveID()) {
-  case Type::BoolTyID:
-  case Type::UByteTyID:
-  case Type::SByteTyID:     
-  case Type::UShortTyID:
-  case Type::ShortTyID:     
-    return optSizeForSubWordData;
+unsigned int
+TargetMachine::findOptimalStorageSize(const Type* ty) const
+{
+  switch(ty->getPrimitiveID())
+    {
+    case Type::BoolTyID:
+    case Type::UByteTyID:
+    case Type::SByteTyID:     
+    case Type::UShortTyID:
+    case Type::ShortTyID:     
+      return optSizeForSubWordData;
     
-  default:
-    return DataLayout.getTypeSize(ty);
-  }
+    default:
+      return DataLayout.getTypeSize(ty);
+    }
 }
 
 
@@ -50,12 +54,14 @@ MachineInstrInfo::MachineInstrInfo(const MachineInstrDescriptor* _desc,
                                   unsigned int _numRealOpCodes)
   : desc(_desc), descSize(_descSize), numRealOpCodes(_numRealOpCodes)
 {
+  // FIXME: TargetInstrDescriptors should not be global
   assert(TargetInstrDescriptors == NULL && desc != NULL);
   TargetInstrDescriptors = desc;       // initialize global variable
 }  
 
 
-MachineInstrInfo::~MachineInstrInfo() {
+MachineInstrInfo::~MachineInstrInfo()
+{
   TargetInstrDescriptors = NULL;       // reset global variable
 }
 
@@ -67,12 +73,13 @@ MachineInstrInfo::constantFitsInImmedField(MachineOpCode opCode,
   // First, check if opCode has an immed field.
   bool isSignExtended;
   uint64_t maxImmedValue = maxImmedConstant(opCode, isSignExtended);
-  if (maxImmedValue != 0) {
-    // Now check if the constant fits
-    if (intValue <= (int64_t) maxImmedValue &&
-       intValue >= -((int64_t) maxImmedValue+1))
-      return true;
-  }
+  if (maxImmedValue != 0)
+    {
+      // Now check if the constant fits
+      if (intValue <= (int64_t) maxImmedValue &&
+         intValue >= -((int64_t) maxImmedValue+1))
+       return true;
+    }
   
   return false;
 }