[PATCH] D109869: [LTO] An option to disable automatic bitcode upgrade

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 26 11:29:56 PST 2022


hoy updated this revision to Diff 403349.
hoy added a comment.

Updating D109869 <https://reviews.llvm.org/D109869>: [LTO] An option to disable automatic bitcode upgrade


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109869

Files:
  llvm/lib/Object/IRSymtab.cpp


Index: llvm/lib/Object/IRSymtab.cpp
===================================================================
--- llvm/lib/Object/IRSymtab.cpp
+++ llvm/lib/Object/IRSymtab.cpp
@@ -43,7 +43,7 @@
 using namespace irsymtab;
 
 cl::opt<bool>
-    DisableBitcodeUpgrade("disable-bitcode-version-upgrade", cl::init(false),
+    DisableBitcodeVersionUpgrade("disable-bitcode-version-upgrade", cl::init(false),
                           cl::Hidden,
                           cl::desc("Disable automatic bitcode upgrade for version mismatch"));
 
@@ -408,7 +408,7 @@
     return make_error<StringError>("Bitcode file does not contain any modules",
                                    inconvertibleErrorCode());
 
-  if (!DisableBitcodeUpgrade) {
+  if (!DisableBitcodeVersionUpgrade) {
     if (BFC.StrtabForSymtab.empty() ||
         BFC.Symtab.size() < sizeof(storage::Header))
       return upgrade(BFC.Mods);
@@ -433,9 +433,8 @@
   // the number of modules in the bitcode file. If they differ, it may mean that
   // the bitcode file was created by binary concatenation, so we need to create
   // a new symbol table from scratch.
-  if (!DisableBitcodeUpgrade)
-    if (FC.TheReader.getNumModules() != BFC.Mods.size())
-      return upgrade(std::move(BFC.Mods));
+  if (FC.TheReader.getNumModules() != BFC.Mods.size())
+    return upgrade(std::move(BFC.Mods));
 
   return std::move(FC);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109869.403349.patch
Type: text/x-patch
Size: 1383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220126/3d90333f/attachment-0001.bin>


More information about the llvm-commits mailing list