Mercurial > hg > CbC > CbC_llvm
view lib/Analysis/PtrUseVisitor.cpp @ 77:54457678186b LLVM3.6
LLVM 3.6
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Sep 2014 22:06:00 +0900 |
parents | 95c75e76d11b |
children | 60c9769439b8 |
line wrap: on
line source
//===- PtrUseVisitor.cpp - InstVisitors over a pointers uses --------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// \file /// Implementation of the pointer use visitors. /// //===----------------------------------------------------------------------===// #include "llvm/Analysis/PtrUseVisitor.h" using namespace llvm; void detail::PtrUseVisitorBase::enqueueUsers(Instruction &I) { for (Use &U : I.uses()) { if (VisitedUses.insert(&U)) { UseToVisit NewU = { UseToVisit::UseAndIsOffsetKnownPair(&U, IsOffsetKnown), Offset }; Worklist.push_back(std::move(NewU)); } } } bool detail::PtrUseVisitorBase::adjustOffsetForGEP(GetElementPtrInst &GEPI) { if (!IsOffsetKnown) return false; return GEPI.accumulateConstantOffset(DL, Offset); }