[PATCH] D71219: Fix conflict value for metadata "Objective-C Garbage Collection" in the mix of swift and Objective-C bitcode

Jin Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 21:55:32 PDT 2020


jinlin added inline comments.


================
Comment at: clang/lib/CodeGen/CGObjCMac.cpp:5173
+    // Clang keeps "Objective-C Garbage Collection" metadata and
+    // the value should be i8 instead of i32.
     Mod.addModuleFlag(llvm::Module::Error,
----------------
rjmccall wrote:
> These two comments are both just restating the code and can be dropped.
Removed these two as suggested.


================
Comment at: llvm/lib/IR/AutoUpgrade.cpp:4069
+        assert(Md->getValue() && "Expected non-empty metadata");
+        assert(Md->getValue()->getType() && "Expected non-empty type");
+        auto Type = Md->getValue()->getType();
----------------
rjmccall wrote:
> We don't generally assert basic structural well-formedness properties like "values have types", or else we'd have a million assertions everywhere.
Remove as suggested.


================
Comment at: llvm/lib/IR/AutoUpgrade.cpp:4083
+          ConstantAsMetadata::get(ConstantInt::get(Int32Ty,Module::Error)) :
+          Op->getOperand(0),
+          Op->getOperand(1),
----------------
steven_wu wrote:
> Should we upgrade the first operand to `Error`? That also means you need to update your test case.
Updated.


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

https://reviews.llvm.org/D71219





More information about the llvm-commits mailing list