You've already forked linux-packaging-mono
Imported Upstream version 5.18.0.161
Former-commit-id: 4db48158d3a35497b8f118ab21b5f08ac3d86d98
This commit is contained in:
parent
37fbf886a3
commit
e19d552987
39
external/llvm/lib/Analysis/PtrUseVisitor.cpp
vendored
Normal file
39
external/llvm/lib/Analysis/PtrUseVisitor.cpp
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
//===- 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"
|
||||
#include "llvm/IR/Instruction.h"
|
||||
#include "llvm/IR/Instructions.h"
|
||||
#include <algorithm>
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
void detail::PtrUseVisitorBase::enqueueUsers(Instruction &I) {
|
||||
for (Use &U : I.uses()) {
|
||||
if (VisitedUses.insert(&U).second) {
|
||||
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);
|
||||
}
|
Reference in New Issue
Block a user