[PATCH] D140985: [IR] Support importing modules with invalid data layouts.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 10 08:53:34 PST 2023


nikic added a reviewer: nikic.
nikic added inline comments.
Herald added a subscriber: StephenFan.


================
Comment at: llvm/lib/AsmParser/LLParser.cpp:384
+          DataLayoutCallback(M->getTargetTriple(), TentativeDLStr)) {
+    M->setDataLayout(*LayoutOverride);
+  } else {
----------------
It would be better to go through `DataLayout::parse` here as well, and report without location. setDataLayout will cause a fatal error for invalid data layouts, I believe.


================
Comment at: llvm/lib/Bitcode/Reader/BitcodeReader.cpp:4210
+    TentativeDataLayoutStr = llvm::UpgradeDataLayoutString(
+        TentativeDataLayoutStr, TheModule->getTargetTriple());
+
----------------
High level question: Why is the existing UpgradeDataLayoutString mechanigm not sufficient?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140985/new/

https://reviews.llvm.org/D140985



More information about the llvm-commits mailing list