Get rid of selects the easy way
[oota-llvm.git] / lib / Target / TargetMachine.cpp
index 2c8b79622a43e50c4d73f7a81ffc2dfbe6620aa7..edb8c54ae9d6f07cf92c2dab2bceecb57cd38430 100644 (file)
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Type.h"
 #include "llvm/IntrinsicLowering.h"
+#include "Support/CommandLine.h"
 using namespace llvm;
 
+//---------------------------------------------------------------------------
+// Command-line options that tend to be useful on more than one back-end.
+//
+
+namespace llvm { 
+  bool PrintMachineCode;
+};
+namespace {
+  cl::opt<bool, true> PrintCode("print-machineinstrs",
+    cl::desc("Print generated machine code"),
+    cl::location(PrintMachineCode), cl::init(false));
+};
+
 //---------------------------------------------------------------------------
 // TargetMachine Class
 //
@@ -40,10 +54,3 @@ TargetMachine::~TargetMachine() {
   delete IL;
 }
 
-unsigned TargetMachine::findOptimalStorageSize(const Type *Ty) const {
-  // All integer types smaller than ints promote to 4 byte integers.
-  if (Ty->isIntegral() && Ty->getPrimitiveSize() < 4)
-    return 4;
-
-  return DataLayout.getTypeSize(Ty);
-}