diff options
| author | Dan Gohman <gohman@apple.com> | 2009-08-27 17:55:13 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-08-27 17:55:13 +0000 |
| commit | 4ce5ade09d130d21d2a7f76ba88520551f153210 (patch) | |
| tree | 44628a44c4692d6946caf547e2ac56a8b51a00f9 /llvm/lib | |
| parent | aba809befd26250e2da24054b346733220245dc1 (diff) | |
| download | bcm5719-llvm-4ce5ade09d130d21d2a7f76ba88520551f153210.tar.gz bcm5719-llvm-4ce5ade09d130d21d2a7f76ba88520551f153210.zip | |
Teach getUnderlyingObject and skipPointerCasts about GlobalAliases.
llvm-svn: 80265
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/Value.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp index 34291b9d728..f6740626096 100644 --- a/llvm/lib/VMCore/Value.cpp +++ b/llvm/lib/VMCore/Value.cpp @@ -340,6 +340,10 @@ Value *Value::stripPointerCasts() { V = GEP->getPointerOperand(); } else if (Operator::getOpcode(V) == Instruction::BitCast) { V = cast<Operator>(V)->getOperand(0); + } else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) { + if (GA->mayBeOverridden()) + return V; + V = GA->getAliasee(); } else { return V; } @@ -357,6 +361,10 @@ Value *Value::getUnderlyingObject() { V = GEP->getPointerOperand(); } else if (Operator::getOpcode(V) == Instruction::BitCast) { V = cast<Operator>(V)->getOperand(0); + } else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) { + if (GA->mayBeOverridden()) + return V; + V = GA->getAliasee(); } else { return V; } |

