[PATCH] D94166: Make the recursive behavior of getBaseObject uniform for GlobalIndirectSymbols

Itay Bookstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 03:03:31 PST 2021


ibookstein created this revision.
ibookstein added a reviewer: DmitryPolukhin.
ibookstein added a project: LLVM.
Herald added subscribers: dexonsmith, hiraditya.
ibookstein requested review of this revision.
Herald added a subscriber: llvm-commits.

As discussed on https://lists.llvm.org/pipermail/llvm-dev/2020-September/145031.html

Previously, the getBaseObject() on a GlobalIFunc returned its resolver function,
but calling it on a GlobalAlias which points to a GlobalIFunc returned nullptr.
This patch fixes the issue and makes the recursive traversal more uniform by
starting with `this` rather than `getOperand(0)`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94166

Files:
  llvm/lib/IR/Globals.cpp


Index: llvm/lib/IR/Globals.cpp
===================================================================
--- llvm/lib/IR/Globals.cpp
+++ llvm/lib/IR/Globals.cpp
@@ -466,7 +466,7 @@
 
 const GlobalObject *GlobalIndirectSymbol::getBaseObject() const {
   DenseSet<const GlobalAlias *> Aliases;
-  return findBaseObject(getOperand(0), Aliases);
+  return findBaseObject(this, Aliases);
 }
 
 //===----------------------------------------------------------------------===//


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94166.314813.patch
Type: text/x-patch
Size: 464 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210106/7e5ec7a6/attachment.bin>


More information about the llvm-commits mailing list