1 //===- PtrUseVisitor.cpp - InstVisitors over a pointers uses --------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 /// Implementation of the pointer use visitors.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/Analysis/PtrUseVisitor.h"
18 void detail::PtrUseVisitorBase::enqueueUsers(Instruction &I) {
19 for (Use &U : I.uses()) {
20 if (VisitedUses.insert(&U).second) {
22 UseToVisit::UseAndIsOffsetKnownPair(&U, IsOffsetKnown),
25 Worklist.push_back(std::move(NewU));
30 bool detail::PtrUseVisitorBase::adjustOffsetForGEP(GetElementPtrInst &GEPI) {
34 return GEPI.accumulateConstantOffset(DL, Offset);