Chris Lattner | eef2fe7 | 2006-01-24 04:13:11 +0000 | [diff] [blame] | 1 | //===-- Globals.cpp - Implement the GlobalValue & GlobalVariable class ----===// |
Misha Brukman | b1c9317 | 2005-04-21 23:48:37 +0000 | [diff] [blame] | 2 | // |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | f3ebc3f | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Misha Brukman | b1c9317 | 2005-04-21 23:48:37 +0000 | [diff] [blame] | 7 | // |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the GlobalValue & GlobalVariable classes for the VMCore |
| 11 | // library. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Anton Korobeynikov | 546ea7e | 2007-04-29 18:02:48 +0000 | [diff] [blame] | 15 | #include "llvm/Constants.h" |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 16 | #include "llvm/GlobalVariable.h" |
Anton Korobeynikov | a97b694 | 2007-04-25 14:27:10 +0000 | [diff] [blame] | 17 | #include "llvm/GlobalAlias.h" |
Chris Lattner | eef2fe7 | 2006-01-24 04:13:11 +0000 | [diff] [blame] | 18 | #include "llvm/DerivedTypes.h" |
Owen Anderson | 5948fdf | 2009-07-08 01:26:06 +0000 | [diff] [blame] | 19 | #include "llvm/LLVMContext.h" |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 20 | #include "llvm/Module.h" |
Anton Korobeynikov | da7db7d | 2008-03-11 22:28:56 +0000 | [diff] [blame] | 21 | #include "llvm/ADT/SmallPtrSet.h" |
Torok Edwin | 6dd2730 | 2009-07-08 18:01:40 +0000 | [diff] [blame] | 22 | #include "llvm/Support/ErrorHandling.h" |
Reid Spencer | 7c16caa | 2004-09-01 22:55:40 +0000 | [diff] [blame] | 23 | #include "llvm/Support/LeakDetector.h" |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 24 | using namespace llvm; |
| 25 | |
| 26 | //===----------------------------------------------------------------------===// |
| 27 | // GlobalValue Class |
| 28 | //===----------------------------------------------------------------------===// |
| 29 | |
Chris Lattner | dd89d9c | 2007-02-26 05:02:39 +0000 | [diff] [blame] | 30 | /// removeDeadUsersOfConstant - If the specified constantexpr is dead, remove |
| 31 | /// it. This involves recursively eliminating any dead users of the |
| 32 | /// constantexpr. |
Chris Lattner | 6f884e0 | 2009-03-09 05:50:45 +0000 | [diff] [blame] | 33 | static bool removeDeadUsersOfConstant(const Constant *C) { |
Chris Lattner | 0145eb7 | 2004-07-18 08:12:57 +0000 | [diff] [blame] | 34 | if (isa<GlobalValue>(C)) return false; // Cannot remove this |
| 35 | |
Chris Lattner | dd89d9c | 2007-02-26 05:02:39 +0000 | [diff] [blame] | 36 | while (!C->use_empty()) { |
Chris Lattner | 6f884e0 | 2009-03-09 05:50:45 +0000 | [diff] [blame] | 37 | const Constant *User = dyn_cast<Constant>(C->use_back()); |
Chris Lattner | dd89d9c | 2007-02-26 05:02:39 +0000 | [diff] [blame] | 38 | if (!User) return false; // Non-constant usage; |
| 39 | if (!removeDeadUsersOfConstant(User)) |
| 40 | return false; // Constant wasn't dead |
| 41 | } |
Chris Lattner | 0145eb7 | 2004-07-18 08:12:57 +0000 | [diff] [blame] | 42 | |
Chris Lattner | 6f884e0 | 2009-03-09 05:50:45 +0000 | [diff] [blame] | 43 | const_cast<Constant*>(C)->destroyConstant(); |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 44 | return true; |
| 45 | } |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 46 | |
| 47 | /// removeDeadConstantUsers - If there are any dead constant users dangling |
| 48 | /// off of this global value, remove them. This method is useful for clients |
| 49 | /// that want to check to see if a global is unused, but don't want to deal |
| 50 | /// with potentially dead constants hanging off of the globals. |
Chris Lattner | 6f884e0 | 2009-03-09 05:50:45 +0000 | [diff] [blame] | 51 | void GlobalValue::removeDeadConstantUsers() const { |
| 52 | Value::use_const_iterator I = use_begin(), E = use_end(); |
| 53 | Value::use_const_iterator LastNonDeadUser = E; |
Chris Lattner | dd89d9c | 2007-02-26 05:02:39 +0000 | [diff] [blame] | 54 | while (I != E) { |
Chris Lattner | 6f884e0 | 2009-03-09 05:50:45 +0000 | [diff] [blame] | 55 | if (const Constant *User = dyn_cast<Constant>(*I)) { |
Chris Lattner | dd89d9c | 2007-02-26 05:02:39 +0000 | [diff] [blame] | 56 | if (!removeDeadUsersOfConstant(User)) { |
| 57 | // If the constant wasn't dead, remember that this was the last live use |
| 58 | // and move on to the next constant. |
| 59 | LastNonDeadUser = I; |
| 60 | ++I; |
| 61 | } else { |
| 62 | // If the constant was dead, then the iterator is invalidated. |
| 63 | if (LastNonDeadUser == E) { |
| 64 | I = use_begin(); |
| 65 | if (I == E) break; |
| 66 | } else { |
| 67 | I = LastNonDeadUser; |
| 68 | ++I; |
| 69 | } |
| 70 | } |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 71 | } else { |
Chris Lattner | dd89d9c | 2007-02-26 05:02:39 +0000 | [diff] [blame] | 72 | LastNonDeadUser = I; |
| 73 | ++I; |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 74 | } |
| 75 | } |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 76 | } |
| 77 | |
Misha Brukman | b1c9317 | 2005-04-21 23:48:37 +0000 | [diff] [blame] | 78 | /// Override destroyConstant to make sure it doesn't get called on |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 79 | /// GlobalValue's because they shouldn't be treated like other constants. |
Owen Anderson | 0d2de8c | 2009-06-20 00:24:58 +0000 | [diff] [blame] | 80 | void GlobalValue::destroyConstant() { |
Torok Edwin | fbcc663 | 2009-07-14 16:55:14 +0000 | [diff] [blame] | 81 | llvm_unreachable("You can't GV->destroyConstant()!"); |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 82 | } |
Duncan Sands | dd7daee | 2008-05-26 19:58:59 +0000 | [diff] [blame] | 83 | |
| 84 | /// copyAttributesFrom - copy all additional attributes (those not needed to |
| 85 | /// create a GlobalValue) from the GlobalValue Src to this one. |
| 86 | void GlobalValue::copyAttributesFrom(const GlobalValue *Src) { |
| 87 | setAlignment(Src->getAlignment()); |
| 88 | setSection(Src->getSection()); |
| 89 | setVisibility(Src->getVisibility()); |
| 90 | } |
| 91 | |
| 92 | |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 93 | //===----------------------------------------------------------------------===// |
| 94 | // GlobalVariable Implementation |
| 95 | //===----------------------------------------------------------------------===// |
| 96 | |
Owen Anderson | 5948fdf | 2009-07-08 01:26:06 +0000 | [diff] [blame] | 97 | GlobalVariable::GlobalVariable(LLVMContext &Context, const Type *Ty, |
| 98 | bool constant, LinkageTypes Link, |
Daniel Dunbar | 4975db6 | 2009-07-25 04:41:11 +0000 | [diff] [blame] | 99 | Constant *InitVal, const Twine &Name, |
Owen Anderson | b17f329 | 2009-07-08 19:03:57 +0000 | [diff] [blame] | 100 | bool ThreadLocal, unsigned AddressSpace) |
Owen Anderson | 4056ca9 | 2009-07-29 22:17:13 +0000 | [diff] [blame^] | 101 | : GlobalValue(PointerType::get(Ty, AddressSpace), |
Owen Anderson | 5948fdf | 2009-07-08 01:26:06 +0000 | [diff] [blame] | 102 | Value::GlobalVariableVal, |
Gabor Greif | f6caff66 | 2008-05-10 08:32:32 +0000 | [diff] [blame] | 103 | OperandTraits<GlobalVariable>::op_begin(this), |
| 104 | InitVal != 0, Link, Name), |
Lauro Ramos Venancio | 749e466 | 2007-04-12 18:32:50 +0000 | [diff] [blame] | 105 | isConstantGlobal(constant), isThreadLocalSymbol(ThreadLocal) { |
Chris Lattner | 5d1bc2c | 2005-01-29 00:35:33 +0000 | [diff] [blame] | 106 | if (InitVal) { |
| 107 | assert(InitVal->getType() == Ty && |
Alkis Evlogimenos | f45cc7a | 2004-08-05 11:28:34 +0000 | [diff] [blame] | 108 | "Initializer should be the same type as the GlobalVariable!"); |
Gabor Greif | 2d3024d | 2008-05-26 21:33:52 +0000 | [diff] [blame] | 109 | Op<0>() = InitVal; |
Alkis Evlogimenos | f45cc7a | 2004-08-05 11:28:34 +0000 | [diff] [blame] | 110 | } |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 111 | |
| 112 | LeakDetector::addGarbageObject(this); |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 113 | } |
| 114 | |
Owen Anderson | b17f329 | 2009-07-08 19:03:57 +0000 | [diff] [blame] | 115 | GlobalVariable::GlobalVariable(Module &M, const Type *Ty, bool constant, |
| 116 | LinkageTypes Link, Constant *InitVal, |
Daniel Dunbar | 4975db6 | 2009-07-25 04:41:11 +0000 | [diff] [blame] | 117 | const Twine &Name, |
Christopher Lamb | 54dd24c | 2007-12-11 08:59:05 +0000 | [diff] [blame] | 118 | GlobalVariable *Before, bool ThreadLocal, |
| 119 | unsigned AddressSpace) |
Owen Anderson | 4056ca9 | 2009-07-29 22:17:13 +0000 | [diff] [blame^] | 120 | : GlobalValue(PointerType::get(Ty, AddressSpace), |
Owen Anderson | 785c56c | 2009-07-08 23:50:31 +0000 | [diff] [blame] | 121 | Value::GlobalVariableVal, |
Gabor Greif | f6caff66 | 2008-05-10 08:32:32 +0000 | [diff] [blame] | 122 | OperandTraits<GlobalVariable>::op_begin(this), |
| 123 | InitVal != 0, Link, Name), |
Lauro Ramos Venancio | 749e466 | 2007-04-12 18:32:50 +0000 | [diff] [blame] | 124 | isConstantGlobal(constant), isThreadLocalSymbol(ThreadLocal) { |
Chris Lattner | 87732cf | 2006-09-30 21:31:26 +0000 | [diff] [blame] | 125 | if (InitVal) { |
| 126 | assert(InitVal->getType() == Ty && |
| 127 | "Initializer should be the same type as the GlobalVariable!"); |
Gabor Greif | 2d3024d | 2008-05-26 21:33:52 +0000 | [diff] [blame] | 128 | Op<0>() = InitVal; |
Chris Lattner | 87732cf | 2006-09-30 21:31:26 +0000 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | LeakDetector::addGarbageObject(this); |
| 132 | |
| 133 | if (Before) |
| 134 | Before->getParent()->getGlobalList().insert(Before, this); |
Owen Anderson | b17f329 | 2009-07-08 19:03:57 +0000 | [diff] [blame] | 135 | else |
| 136 | M.getGlobalList().push_back(this); |
Chris Lattner | 87732cf | 2006-09-30 21:31:26 +0000 | [diff] [blame] | 137 | } |
| 138 | |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 139 | void GlobalVariable::setParent(Module *parent) { |
| 140 | if (getParent()) |
| 141 | LeakDetector::addGarbageObject(this); |
| 142 | Parent = parent; |
| 143 | if (getParent()) |
| 144 | LeakDetector::removeGarbageObject(this); |
| 145 | } |
| 146 | |
Chris Lattner | 02a71e7 | 2004-10-11 22:21:39 +0000 | [diff] [blame] | 147 | void GlobalVariable::removeFromParent() { |
| 148 | getParent()->getGlobalList().remove(this); |
| 149 | } |
| 150 | |
| 151 | void GlobalVariable::eraseFromParent() { |
| 152 | getParent()->getGlobalList().erase(this); |
| 153 | } |
| 154 | |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 155 | void GlobalVariable::replaceUsesOfWithOnConstant(Value *From, Value *To, |
Chris Lattner | 7a1450d | 2005-10-04 18:13:04 +0000 | [diff] [blame] | 156 | Use *U) { |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 157 | // If you call this, then you better know this GVar has a constant |
| 158 | // initializer worth replacing. Enforce that here. |
Misha Brukman | b1c9317 | 2005-04-21 23:48:37 +0000 | [diff] [blame] | 159 | assert(getNumOperands() == 1 && |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 160 | "Attempt to replace uses of Constants on a GVar with no initializer"); |
| 161 | |
| 162 | // And, since you know it has an initializer, the From value better be |
| 163 | // the initializer :) |
| 164 | assert(getOperand(0) == From && |
| 165 | "Attempt to replace wrong constant initializer in GVar"); |
| 166 | |
| 167 | // And, you better have a constant for the replacement value |
| 168 | assert(isa<Constant>(To) && |
| 169 | "Attempt to replace GVar initializer with non-constant"); |
Misha Brukman | b1c9317 | 2005-04-21 23:48:37 +0000 | [diff] [blame] | 170 | |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 171 | // Okay, preconditions out of the way, replace the constant initializer. |
Chris Lattner | 37b570a | 2004-08-04 02:27:17 +0000 | [diff] [blame] | 172 | this->setOperand(0, cast<Constant>(To)); |
Reid Spencer | 3d169b1 | 2004-07-18 00:06:26 +0000 | [diff] [blame] | 173 | } |
Anton Korobeynikov | a97b694 | 2007-04-25 14:27:10 +0000 | [diff] [blame] | 174 | |
Duncan Sands | dd7daee | 2008-05-26 19:58:59 +0000 | [diff] [blame] | 175 | /// copyAttributesFrom - copy all additional attributes (those not needed to |
| 176 | /// create a GlobalVariable) from the GlobalVariable Src to this one. |
| 177 | void GlobalVariable::copyAttributesFrom(const GlobalValue *Src) { |
| 178 | assert(isa<GlobalVariable>(Src) && "Expected a GlobalVariable!"); |
| 179 | GlobalValue::copyAttributesFrom(Src); |
| 180 | const GlobalVariable *SrcVar = cast<GlobalVariable>(Src); |
| 181 | setThreadLocal(SrcVar->isThreadLocal()); |
| 182 | } |
| 183 | |
| 184 | |
Anton Korobeynikov | a97b694 | 2007-04-25 14:27:10 +0000 | [diff] [blame] | 185 | //===----------------------------------------------------------------------===// |
| 186 | // GlobalAlias Implementation |
| 187 | //===----------------------------------------------------------------------===// |
| 188 | |
| 189 | GlobalAlias::GlobalAlias(const Type *Ty, LinkageTypes Link, |
Daniel Dunbar | d43b86d | 2009-07-25 06:02:13 +0000 | [diff] [blame] | 190 | const Twine &Name, Constant* aliasee, |
Anton Korobeynikov | a97b694 | 2007-04-25 14:27:10 +0000 | [diff] [blame] | 191 | Module *ParentModule) |
Gabor Greif | f6caff66 | 2008-05-10 08:32:32 +0000 | [diff] [blame] | 192 | : GlobalValue(Ty, Value::GlobalAliasVal, &Op<0>(), 1, Link, Name) { |
Anton Korobeynikov | a97b694 | 2007-04-25 14:27:10 +0000 | [diff] [blame] | 193 | LeakDetector::addGarbageObject(this); |
| 194 | |
Anton Korobeynikov | b18f8f8 | 2007-04-28 13:45:00 +0000 | [diff] [blame] | 195 | if (aliasee) |
| 196 | assert(aliasee->getType() == Ty && "Alias and aliasee types should match!"); |
Gabor Greif | 2d3024d | 2008-05-26 21:33:52 +0000 | [diff] [blame] | 197 | Op<0>() = aliasee; |
Anton Korobeynikov | b18f8f8 | 2007-04-28 13:45:00 +0000 | [diff] [blame] | 198 | |
Anton Korobeynikov | a97b694 | 2007-04-25 14:27:10 +0000 | [diff] [blame] | 199 | if (ParentModule) |
| 200 | ParentModule->getAliasList().push_back(this); |
| 201 | } |
| 202 | |
| 203 | void GlobalAlias::setParent(Module *parent) { |
| 204 | if (getParent()) |
| 205 | LeakDetector::addGarbageObject(this); |
| 206 | Parent = parent; |
| 207 | if (getParent()) |
| 208 | LeakDetector::removeGarbageObject(this); |
| 209 | } |
| 210 | |
| 211 | void GlobalAlias::removeFromParent() { |
| 212 | getParent()->getAliasList().remove(this); |
| 213 | } |
| 214 | |
| 215 | void GlobalAlias::eraseFromParent() { |
| 216 | getParent()->getAliasList().erase(this); |
| 217 | } |
| 218 | |
| 219 | bool GlobalAlias::isDeclaration() const { |
Anton Korobeynikov | 546ea7e | 2007-04-29 18:02:48 +0000 | [diff] [blame] | 220 | const GlobalValue* AV = getAliasedGlobal(); |
| 221 | if (AV) |
| 222 | return AV->isDeclaration(); |
| 223 | else |
| 224 | return false; |
Anton Korobeynikov | a97b694 | 2007-04-25 14:27:10 +0000 | [diff] [blame] | 225 | } |
| 226 | |
Anton Korobeynikov | b18f8f8 | 2007-04-28 13:45:00 +0000 | [diff] [blame] | 227 | void GlobalAlias::setAliasee(Constant *Aliasee) |
Anton Korobeynikov | a97b694 | 2007-04-25 14:27:10 +0000 | [diff] [blame] | 228 | { |
Anton Korobeynikov | 546ea7e | 2007-04-29 18:02:48 +0000 | [diff] [blame] | 229 | if (Aliasee) |
| 230 | assert(Aliasee->getType() == getType() && |
Anton Korobeynikov | b18f8f8 | 2007-04-28 13:45:00 +0000 | [diff] [blame] | 231 | "Alias and aliasee types should match!"); |
Anton Korobeynikov | 546ea7e | 2007-04-29 18:02:48 +0000 | [diff] [blame] | 232 | |
| 233 | setOperand(0, Aliasee); |
| 234 | } |
| 235 | |
Chris Lattner | c2d0530 | 2007-05-05 23:49:02 +0000 | [diff] [blame] | 236 | const GlobalValue *GlobalAlias::getAliasedGlobal() const { |
Anton Korobeynikov | 546ea7e | 2007-04-29 18:02:48 +0000 | [diff] [blame] | 237 | const Constant *C = getAliasee(); |
| 238 | if (C) { |
| 239 | if (const GlobalValue *GV = dyn_cast<GlobalValue>(C)) |
| 240 | return GV; |
| 241 | else { |
| 242 | const ConstantExpr *CE = 0; |
Anton Korobeynikov | a30bc8f | 2007-04-30 10:28:40 +0000 | [diff] [blame] | 243 | if ((CE = dyn_cast<ConstantExpr>(C)) && |
Chris Lattner | c2d0530 | 2007-05-05 23:49:02 +0000 | [diff] [blame] | 244 | (CE->getOpcode() == Instruction::BitCast || |
| 245 | CE->getOpcode() == Instruction::GetElementPtr)) |
| 246 | return dyn_cast<GlobalValue>(CE->getOperand(0)); |
Anton Korobeynikov | 546ea7e | 2007-04-29 18:02:48 +0000 | [diff] [blame] | 247 | else |
Torok Edwin | fbcc663 | 2009-07-14 16:55:14 +0000 | [diff] [blame] | 248 | llvm_unreachable("Unsupported aliasee"); |
Anton Korobeynikov | 546ea7e | 2007-04-29 18:02:48 +0000 | [diff] [blame] | 249 | } |
Jeff Cohen | ee7bf76 | 2007-05-03 22:09:21 +0000 | [diff] [blame] | 250 | } |
| 251 | return 0; |
Anton Korobeynikov | a97b694 | 2007-04-25 14:27:10 +0000 | [diff] [blame] | 252 | } |
| 253 | |
Anton Korobeynikov | 1a11404 | 2008-09-09 20:05:04 +0000 | [diff] [blame] | 254 | const GlobalValue *GlobalAlias::resolveAliasedGlobal(bool stopOnWeak) const { |
Anton Korobeynikov | 2fb3897 | 2008-03-22 07:48:40 +0000 | [diff] [blame] | 255 | SmallPtrSet<const GlobalValue*, 3> Visited; |
Anton Korobeynikov | da7db7d | 2008-03-11 22:28:56 +0000 | [diff] [blame] | 256 | |
Anton Korobeynikov | ac2c655 | 2008-09-09 18:23:48 +0000 | [diff] [blame] | 257 | // Check if we need to stop early. |
Duncan Sands | 715b289 | 2009-01-08 20:55:49 +0000 | [diff] [blame] | 258 | if (stopOnWeak && mayBeOverridden()) |
Anton Korobeynikov | ac2c655 | 2008-09-09 18:23:48 +0000 | [diff] [blame] | 259 | return this; |
| 260 | |
Anton Korobeynikov | da7db7d | 2008-03-11 22:28:56 +0000 | [diff] [blame] | 261 | const GlobalValue *GV = getAliasedGlobal(); |
| 262 | Visited.insert(GV); |
| 263 | |
Anton Korobeynikov | ac2c655 | 2008-09-09 18:23:48 +0000 | [diff] [blame] | 264 | // Iterate over aliasing chain, stopping on weak alias if necessary. |
Anton Korobeynikov | da7db7d | 2008-03-11 22:28:56 +0000 | [diff] [blame] | 265 | while (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV)) { |
Duncan Sands | 715b289 | 2009-01-08 20:55:49 +0000 | [diff] [blame] | 266 | if (stopOnWeak && GA->mayBeOverridden()) |
Anton Korobeynikov | ac2c655 | 2008-09-09 18:23:48 +0000 | [diff] [blame] | 267 | break; |
| 268 | |
Anton Korobeynikov | da7db7d | 2008-03-11 22:28:56 +0000 | [diff] [blame] | 269 | GV = GA->getAliasedGlobal(); |
| 270 | |
| 271 | if (!Visited.insert(GV)) |
| 272 | return NULL; |
| 273 | } |
| 274 | |
| 275 | return GV; |
| 276 | } |