[llvm] [AsmParser] Add support for reading incomplete IR (part 1) (PR #78421)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 03:59:09 PST 2024


================
@@ -269,10 +330,14 @@ bool LLParser::validateEndOfModule(bool UpgradeDebugInfo) {
 
   for (auto *Inst : InstsWithTBAATag) {
     MDNode *MD = Inst->getMetadata(LLVMContext::MD_tbaa);
-    assert(MD && "UpgradeInstWithTBAATag should have a TBAA tag");
-    auto *UpgradedMD = UpgradeTBAANode(*MD);
-    if (MD != UpgradedMD)
-      Inst->setMetadata(LLVMContext::MD_tbaa, UpgradedMD);
+    // With incomplete IR, the tbaa metadata may have been dropped.
+    if (!AllowIncompleteIR)
+      assert(MD && "UpgradeInstWithTBAATag should have a TBAA tag");
----------------
dtcxzyw wrote:

Use `return error(...)` instead?


https://github.com/llvm/llvm-project/pull/78421


More information about the llvm-commits mailing list