mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 02:24:22 +00:00
Re-applying the target data layout verification patch from r142288, plus appropriate CMake dependencies.
Thanks to Raphael Espindola for tracking down the CMake issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142306 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user