@@ -229,33 +229,33 @@ void GlobalAlias::setAliasee(Constant *Aliasee) {
229
229
setOperand (0 , Aliasee);
230
230
}
231
231
232
- const GlobalValue *GlobalAlias::getAliasedGlobal () const {
233
- const Constant *C = getAliasee ();
232
+ GlobalValue *GlobalAlias::getAliasedGlobal () {
233
+ Constant *C = getAliasee ();
234
234
if (C == 0 ) return 0 ;
235
235
236
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(C))
236
+ if (GlobalValue *GV = dyn_cast<GlobalValue>(C))
237
237
return GV;
238
238
239
- const ConstantExpr *CE = cast<ConstantExpr>(C);
239
+ ConstantExpr *CE = cast<ConstantExpr>(C);
240
240
assert ((CE->getOpcode () == Instruction::BitCast ||
241
241
CE->getOpcode () == Instruction::GetElementPtr) &&
242
242
" Unsupported aliasee" );
243
243
244
244
return cast<GlobalValue>(CE->getOperand (0 ));
245
245
}
246
246
247
- const GlobalValue *GlobalAlias::resolveAliasedGlobal (bool stopOnWeak) const {
248
- SmallPtrSet<const GlobalValue*, 3 > Visited;
247
+ GlobalValue *GlobalAlias::resolveAliasedGlobal (bool stopOnWeak) {
248
+ SmallPtrSet<GlobalValue*, 3 > Visited;
249
249
250
250
// Check if we need to stop early.
251
251
if (stopOnWeak && mayBeOverridden ())
252
252
return this ;
253
253
254
- const GlobalValue *GV = getAliasedGlobal ();
254
+ GlobalValue *GV = getAliasedGlobal ();
255
255
Visited.insert (GV);
256
256
257
257
// Iterate over aliasing chain, stopping on weak alias if necessary.
258
- while (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV)) {
258
+ while (GlobalAlias *GA = dyn_cast<GlobalAlias>(GV)) {
259
259
if (stopOnWeak && GA->mayBeOverridden ())
260
260
break ;
261
261
0 commit comments