Backing out patch. Will refactor to remove the AsmParser dependency on Target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142323 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Lang Hames
2011-10-18 00:23:49 +00:00
parent 6248a546f2
commit d8ffe5bb16
4 changed files with 38 additions and 116 deletions

View File

@ -24,7 +24,6 @@
#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) {
@ -261,14 +260,9 @@ 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;
}