summaryrefslogtreecommitdiff
path: root/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AsmParser/LLParser.cpp')
-rw-r--r--lib/AsmParser/LLParser.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index cafaab01af..eb6afd36c7 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/lib/AsmParser/LLParser.cpp
@@ -24,6 +24,7 @@
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Target/TargetData.h"
using namespace llvm;
static std::string getTypeString(Type *T) {
@@ -260,9 +261,14 @@ bool LLParser::ParseTargetDefinition() {
return false;
case lltok::kw_datalayout:
Lex.Lex();
+ LocTy SpecifierLoc = Lex.getLoc();
if (ParseToken(lltok::equal, "expected '=' after target datalayout") ||
ParseStringConstant(Str))
return true;
+ std::string errMsg = TargetData::parseSpecifier(Str);
+ if (errMsg != "") {
+ return Error(SpecifierLoc, errMsg);
+ }
M->setDataLayout(Str);
return false;
}