aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-12 23:18:18 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-12 23:18:18 +0000
commita214cbbc80117685e0f0ea06b15295acda99fb38 (patch)
treedf593d68f98fd1fa21193b4c1df19410a703b9a1 /lib
parentc09b52faff35ae0740c001c635b9967559622f2b (diff)
downloadexternal_llvm-a214cbbc80117685e0f0ea06b15295acda99fb38.zip
external_llvm-a214cbbc80117685e0f0ea06b15295acda99fb38.tar.gz
external_llvm-a214cbbc80117685e0f0ea06b15295acda99fb38.tar.bz2
Add a new home for TargetLowering member functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33152 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/TargetLowering.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/Target/TargetLowering.cpp b/lib/Target/TargetLowering.cpp
new file mode 100644
index 0000000..ac6844a
--- /dev/null
+++ b/lib/Target/TargetLowering.cpp
@@ -0,0 +1,40 @@
+//===-- TargetLowering.cpp - Asm Info --------------------------------------==//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Reid Spencer and is distributed under the
+// University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements methods of the TargetLowering class.
+//
+//===----------------------------------------------------------------------===//
+//
+
+#include "llvm/Target/TargetLowering.h"
+#include "llvm/DerivedTypes.h"
+#include "llvm/CodeGen/ValueTypes.h"
+
+using namespace llvm;
+
+MVT::ValueType TargetLowering::getValueType(const Type *Ty) const {
+ switch (Ty->getTypeID()) {
+ default: assert(0 && "Unknown type!");
+ case Type::VoidTyID: return MVT::isVoid;
+ case Type::IntegerTyID:
+ switch (cast<IntegerType>(Ty)->getBitWidth()) {
+ default: assert(0 && "Invalid width for value type");
+ case 1: return MVT::i1;
+ case 8: return MVT::i8;
+ case 16: return MVT::i16;
+ case 32: return MVT::i32;
+ case 64: return MVT::i64;
+ }
+ break;
+ case Type::FloatTyID: return MVT::f32;
+ case Type::DoubleTyID: return MVT::f64;
+ case Type::PointerTyID: return PointerTy;
+ case Type::PackedTyID: return MVT::Vector;
+ }
+}