Make all of the TargetMachine subclasses use the new string TargetData methods.

This is part of the on-going work on PR 761.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28414 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index ad13b1e..7bb7763 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -123,6 +123,10 @@
 
 TargetData::TargetData(const std::string &TargetName,
                        const std::string &TargetDescription) {
+  assert(!TargetName.empty() &&
+         "ERROR: Tool did not specify a target data to use!");
+
+                       
   std::string temp = TargetDescription;
   
   LittleEndian = false;
@@ -136,7 +140,7 @@
   ByteAlignment  = 1;
   BoolAlignment   = 1;
   
-  while (temp.length() > 0) {
+  while (!temp.empty()) {
     std::string token = getToken(temp, "-");
     
     char signal = getToken(token, ":")[0];