[PATCH] D104950: [OpaquePtr] Support forward references in textual IR

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 28 15:24:29 PDT 2021


aeubanks added inline comments.


================
Comment at: llvm/lib/AsmParser/LLParser.cpp:1463
+  // RAUW it later with a global/function of the correct type.
+  Type *ElemTy = PTy->isOpaque() ? Type::getInt8Ty(M->getContext())
+                                 : PTy->getElementType();
----------------
With --force-opaque-pointers, we never get to `Function::Create()`. Can we always create a GlobalVariable (or always create a Function) and RAUW with the proper GlobalVariable/Function later?


================
Comment at: llvm/lib/IR/AsmWriter.cpp:188
 
-  bool GetsReversed =
-      !isa<GlobalVariable>(V) && !isa<Function>(V) && !isa<BasicBlock>(V);
+  bool GetsReversed = !isa<BasicBlock>(V);
   if (auto *BA = dyn_cast<BlockAddress>(V))
----------------
could you explain this change?


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

https://reviews.llvm.org/D104950



More information about the llvm-commits mailing list