From 68eae4985995f06a8bbfadb9cf420a66cbfbe04a Mon Sep 17 00:00:00 2001 From: Amy Huang Date: Wed, 18 Sep 2019 22:15:58 +0000 Subject: 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 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index af90607..89a5b7b 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -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); } } -- cgit v1.1