diff options
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/Value.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/include/llvm/Value.h b/llvm/include/llvm/Value.h index f0bd8bea1ed..9045906e7be 100644 --- a/llvm/include/llvm/Value.h +++ b/llvm/include/llvm/Value.h @@ -285,10 +285,11 @@ public: /// getUnderlyingObject - This method strips off any GEP address adjustments /// and pointer casts from the specified value, returning the original object /// being addressed. Note that the returned value has pointer type if the - /// specified value does. - Value *getUnderlyingObject(); - const Value *getUnderlyingObject() const { - return const_cast<Value*>(this)->getUnderlyingObject(); + /// specified value does. If the MaxLookup value is non-zero, it limits the + /// number of instructions to be stripped off. + Value *getUnderlyingObject(unsigned MaxLookup = 6); + const Value *getUnderlyingObject(unsigned MaxLookup = 6) const { + return const_cast<Value*>(this)->getUnderlyingObject(MaxLookup); } /// DoPHITranslation - If this value is a PHI node with CurBB as its parent, |