Add AutoUpgrade function to add new address space datalayout string to existing datalayouts.

Summary:
Add function to AutoUpgrade to change the datalayout of old X86 datalayout strings.
This adds "-p270:32:32-p271:32:32-p272:64:64" to X86 datalayouts that are otherwise valid
and don't already contain it.

This also removes the compatibility changes in https://reviews.llvm.org/D66843.
Datalayout change in https://reviews.llvm.org/D64931.

Reviewers: rnk, echristo

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67631

llvm-svn: 372267
This commit is contained in:
Amy Huang
2019-09-18 22:15:58 +00:00
parent e40ef12bfa
commit 68eae49859
11 changed files with 120 additions and 17 deletions

View File

@@ -3648,6 +3648,11 @@ Error BitcodeReader::parseModule(uint64_t ResumeBit,
break;
}
Record.clear();
// Upgrade data layout string.
std::string DL = llvm::UpgradeDataLayoutString(
TheModule->getDataLayoutStr(), TheModule->getTargetTriple());
TheModule->setDataLayout(DL);
}
}