aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/IPA/GlobalsModRef.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-12-15 20:02:24 +0000
committerDan Gohman <gohman@apple.com>2010-12-15 20:02:24 +0000
commita4fcd2418dc7f0b425a3c1b4fb873fbe4e2e7f72 (patch)
tree962968e998866ffb0bf159c77c4f85e4bc509f3a /llvm/lib/Analysis/IPA/GlobalsModRef.cpp
parenta51174af72e0ff8ccff9e5fc04b11a4c44f4d99c (diff)
downloadllvm-a4fcd2418dc7f0b425a3c1b4fb873fbe4e2e7f72.zip
llvm-a4fcd2418dc7f0b425a3c1b4fb873fbe4e2e7f72.tar.gz
llvm-a4fcd2418dc7f0b425a3c1b4fb873fbe4e2e7f72.tar.bz2
Move Value::getUnderlyingObject to be a standalone
function so that it can live in Analysis instead of VMCore. llvm-svn: 121885
Diffstat (limited to 'llvm/lib/Analysis/IPA/GlobalsModRef.cpp')
-rw-r--r--llvm/lib/Analysis/IPA/GlobalsModRef.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/IPA/GlobalsModRef.cpp b/llvm/lib/Analysis/IPA/GlobalsModRef.cpp
index 456a80a..c18dc47 100644
--- a/llvm/lib/Analysis/IPA/GlobalsModRef.cpp
+++ b/llvm/lib/Analysis/IPA/GlobalsModRef.cpp
@@ -24,6 +24,7 @@
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Analysis/MemoryBuiltins.h"
+#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/InstIterator.h"
#include "llvm/ADT/Statistic.h"
@@ -324,7 +325,7 @@ bool GlobalsModRef::AnalyzeIndirectGlobalMemory(GlobalValue *GV) {
continue;
// Check the value being stored.
- Value *Ptr = SI->getOperand(0)->getUnderlyingObject();
+ Value *Ptr = GetUnderlyingObject(SI->getOperand(0));
if (isMalloc(Ptr)) {
// Okay, easy case.
@@ -489,8 +490,8 @@ AliasAnalysis::AliasResult
GlobalsModRef::alias(const Location &LocA,
const Location &LocB) {
// Get the base object these pointers point to.
- const Value *UV1 = LocA.Ptr->getUnderlyingObject();
- const Value *UV2 = LocB.Ptr->getUnderlyingObject();
+ const Value *UV1 = GetUnderlyingObject(LocA.Ptr);
+ const Value *UV2 = GetUnderlyingObject(LocB.Ptr);
// If either of the underlying values is a global, they may be non-addr-taken
// globals, which we can answer queries about.
@@ -549,7 +550,7 @@ GlobalsModRef::getModRefInfo(ImmutableCallSite CS,
// If we are asking for mod/ref info of a direct call with a pointer to a
// global we are tracking, return information if we have it.
if (const GlobalValue *GV =
- dyn_cast<GlobalValue>(Loc.Ptr->getUnderlyingObject()))
+ dyn_cast<GlobalValue>(GetUnderlyingObject(Loc.Ptr)))
if (GV->hasLocalLinkage())
if (const Function *F = CS.getCalledFunction())
if (NonAddressTakenGlobals.count(GV))