aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/TargetData.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r--lib/Target/TargetData.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index ad13b1ef4e..7bb77636c8 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -123,6 +123,10 @@ TargetData::TargetData(const std::string &TargetName,
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 @@ TargetData::TargetData(const std::string &TargetName,
ByteAlignment = 1;
BoolAlignment = 1;
- while (temp.length() > 0) {
+ while (!temp.empty()) {
std::string token = getToken(temp, "-");
char signal = getToken(token, ":")[0];