Add getABITypeSize, getABITypeSizeInBits

llvm-svn: 42488
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp
index 3028426..0bdb23b 100644
--- a/llvm/lib/Target/TargetData.cpp
+++ b/llvm/lib/Target/TargetData.cpp
@@ -471,7 +471,12 @@
     return getTypeSize(Ty) * 8;
 }
 
-
+uint64_t TargetData::getABITypeSizeInBits(const Type *Ty) const {
+  if (Ty->isInteger())
+    return cast<IntegerType>(Ty)->getBitWidth();
+  else
+    return getABITypeSize(Ty) * 8;
+}
 /*!
   \param abi_or_pref Flag that determines which alignment is returned. true
   returns the ABI alignment, false returns the preferred alignment.