diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2013-08-19 23:13:33 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2013-08-19 23:13:33 +0000 |
| commit | f708c87078a8a3c5075d9a5a1c2f25c3618f6dbc (patch) | |
| tree | 6eef2582261df721d8cc2e48bd7a62d4aead7f87 /llvm/lib | |
| parent | 53e2f275d2991bf171716d56f4668357a68299bc (diff) | |
| download | bcm5719-llvm-f708c87078a8a3c5075d9a5a1c2f25c3618f6dbc.tar.gz bcm5719-llvm-f708c87078a8a3c5075d9a5a1c2f25c3618f6dbc.zip | |
Introduce non-const overloads for GlobalAlias::{get,resolve}AliasedGlobal.
llvm-svn: 188725
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/IR/Globals.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp index 6d547f3edf3..da3b02a0fa6 100644 --- a/llvm/lib/IR/Globals.cpp +++ b/llvm/lib/IR/Globals.cpp @@ -229,14 +229,14 @@ void GlobalAlias::setAliasee(Constant *Aliasee) { setOperand(0, Aliasee); } -const GlobalValue *GlobalAlias::getAliasedGlobal() const { - const Constant *C = getAliasee(); +GlobalValue *GlobalAlias::getAliasedGlobal() { + Constant *C = getAliasee(); if (C == 0) return 0; - if (const GlobalValue *GV = dyn_cast<GlobalValue>(C)) + if (GlobalValue *GV = dyn_cast<GlobalValue>(C)) return GV; - const ConstantExpr *CE = cast<ConstantExpr>(C); + ConstantExpr *CE = cast<ConstantExpr>(C); assert((CE->getOpcode() == Instruction::BitCast || CE->getOpcode() == Instruction::GetElementPtr) && "Unsupported aliasee"); @@ -244,18 +244,18 @@ const GlobalValue *GlobalAlias::getAliasedGlobal() const { return cast<GlobalValue>(CE->getOperand(0)); } -const GlobalValue *GlobalAlias::resolveAliasedGlobal(bool stopOnWeak) const { - SmallPtrSet<const GlobalValue*, 3> Visited; +GlobalValue *GlobalAlias::resolveAliasedGlobal(bool stopOnWeak) { + SmallPtrSet<GlobalValue*, 3> Visited; // Check if we need to stop early. if (stopOnWeak && mayBeOverridden()) return this; - const GlobalValue *GV = getAliasedGlobal(); + GlobalValue *GV = getAliasedGlobal(); Visited.insert(GV); // Iterate over aliasing chain, stopping on weak alias if necessary. - while (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV)) { + while (GlobalAlias *GA = dyn_cast<GlobalAlias>(GV)) { if (stopOnWeak && GA->mayBeOverridden()) break; |

