Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1 | //===-- Value.cpp - Implement the Value class -----------------------------===// |
Misha Brukman | fd93908 | 2005-04-21 23:48:37 +0000 | [diff] [blame] | 2 | // |
John Criswell | b576c94 | 2003-10-20 19:43:21 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 4ee451d | 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 | fd93908 | 2005-04-21 23:48:37 +0000 | [diff] [blame] | 7 | // |
John Criswell | b576c94 | 2003-10-20 19:43:21 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 9 | // |
Misha Brukman | fd93908 | 2005-04-21 23:48:37 +0000 | [diff] [blame] | 10 | // This file implements the Value and User classes. |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Chris Lattner | 28eca8b | 2002-10-09 23:12:59 +0000 | [diff] [blame] | 14 | #include "llvm/Constant.h" |
Chris Lattner | 0d1e407 | 2005-03-05 19:51:50 +0000 | [diff] [blame] | 15 | #include "llvm/DerivedTypes.h" |
| 16 | #include "llvm/InstrTypes.h" |
| 17 | #include "llvm/Module.h" |
Reid Spencer | ef9b9a7 | 2007-02-05 20:47:22 +0000 | [diff] [blame] | 18 | #include "llvm/ValueSymbolTable.h" |
Bill Wendling | 2e3def1 | 2006-11-17 08:03:48 +0000 | [diff] [blame] | 19 | #include "llvm/Support/Debug.h" |
Reid Spencer | 551ccae | 2004-09-01 22:55:40 +0000 | [diff] [blame] | 20 | #include "llvm/Support/LeakDetector.h" |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 21 | #include <algorithm> |
Chris Lattner | 31f8499 | 2003-11-21 20:23:48 +0000 | [diff] [blame] | 22 | using namespace llvm; |
Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 23 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 24 | //===----------------------------------------------------------------------===// |
| 25 | // Value Class |
| 26 | //===----------------------------------------------------------------------===// |
| 27 | |
Chris Lattner | 82d18aa | 2001-12-13 00:41:27 +0000 | [diff] [blame] | 28 | static inline const Type *checkType(const Type *Ty) { |
| 29 | assert(Ty && "Value defined with a null type: Error!"); |
| 30 | return Ty; |
| 31 | } |
| 32 | |
Chris Lattner | dec628e | 2007-02-12 05:18:08 +0000 | [diff] [blame] | 33 | Value::Value(const Type *ty, unsigned scid) |
Chris Lattner | 905547b | 2005-02-05 01:37:58 +0000 | [diff] [blame] | 34 | : SubclassID(scid), SubclassData(0), Ty(checkType(ty)), |
Chris Lattner | dec628e | 2007-02-12 05:18:08 +0000 | [diff] [blame] | 35 | UseList(0), Name(0) { |
Chris Lattner | a9e7781 | 2004-07-06 17:44:17 +0000 | [diff] [blame] | 36 | if (!isa<Constant>(this) && !isa<BasicBlock>(this)) |
Misha Brukman | fd93908 | 2005-04-21 23:48:37 +0000 | [diff] [blame] | 37 | assert((Ty->isFirstClassType() || Ty == Type::VoidTy || |
Chris Lattner | 5c45e6d | 2004-07-07 18:07:46 +0000 | [diff] [blame] | 38 | isa<OpaqueType>(ty)) && |
Chris Lattner | a9e7781 | 2004-07-06 17:44:17 +0000 | [diff] [blame] | 39 | "Cannot create non-first-class values except for constants!"); |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 40 | } |
| 41 | |
Gordon Henriksen | afba8fe | 2007-12-10 02:14:30 +0000 | [diff] [blame] | 42 | Value::~Value() { |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 43 | #ifndef NDEBUG // Only in -g mode... |
Chris Lattner | ee976f3 | 2001-06-11 15:04:40 +0000 | [diff] [blame] | 44 | // Check to make sure that there are no uses of this value that are still |
| 45 | // around when the value is destroyed. If there are, then we have a dangling |
| 46 | // reference and something is wrong. This code is here to print out what is |
Misha Brukman | fd93908 | 2005-04-21 23:48:37 +0000 | [diff] [blame] | 47 | // still being referenced. The value in question should be printed as |
Chris Lattner | ee976f3 | 2001-06-11 15:04:40 +0000 | [diff] [blame] | 48 | // a <badref> |
| 49 | // |
Gordon Henriksen | afba8fe | 2007-12-10 02:14:30 +0000 | [diff] [blame] | 50 | if (!use_empty()) { |
| 51 | DOUT << "While deleting: " << *Ty << " %" << Name << "\n"; |
| 52 | for (use_iterator I = use_begin(), E = use_end(); I != E; ++I) |
Bill Wendling | 2e3def1 | 2006-11-17 08:03:48 +0000 | [diff] [blame] | 53 | DOUT << "Use still stuck around after Def is destroyed:" |
| 54 | << **I << "\n"; |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 55 | } |
| 56 | #endif |
Gordon Henriksen | afba8fe | 2007-12-10 02:14:30 +0000 | [diff] [blame] | 57 | assert(use_empty() && "Uses remain when a value is destroyed!"); |
Chris Lattner | d1e693f | 2002-09-08 18:59:35 +0000 | [diff] [blame] | 58 | |
Chris Lattner | 91857da | 2007-03-20 00:18:10 +0000 | [diff] [blame] | 59 | // If this value is named, destroy the name. This should not be in a symtab |
| 60 | // at this point. |
Gordon Henriksen | afba8fe | 2007-12-10 02:14:30 +0000 | [diff] [blame] | 61 | if (Name) |
| 62 | Name->Destroy(); |
Chris Lattner | 91857da | 2007-03-20 00:18:10 +0000 | [diff] [blame] | 63 | |
Chris Lattner | d1e693f | 2002-09-08 18:59:35 +0000 | [diff] [blame] | 64 | // There should be no uses of this object anymore, remove it. |
Gordon Henriksen | afba8fe | 2007-12-10 02:14:30 +0000 | [diff] [blame] | 65 | LeakDetector::removeGarbageObject(this); |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 66 | } |
| 67 | |
Chris Lattner | 29d1ca6 | 2005-02-01 01:24:21 +0000 | [diff] [blame] | 68 | /// hasNUses - Return true if this Value has exactly N users. |
| 69 | /// |
| 70 | bool Value::hasNUses(unsigned N) const { |
| 71 | use_const_iterator UI = use_begin(), E = use_end(); |
| 72 | |
| 73 | for (; N; --N, ++UI) |
| 74 | if (UI == E) return false; // Too few. |
| 75 | return UI == E; |
| 76 | } |
| 77 | |
Chris Lattner | 8daf056 | 2005-02-23 16:51:11 +0000 | [diff] [blame] | 78 | /// hasNUsesOrMore - Return true if this value has N users or more. This is |
| 79 | /// logically equivalent to getNumUses() >= N. |
| 80 | /// |
| 81 | bool Value::hasNUsesOrMore(unsigned N) const { |
| 82 | use_const_iterator UI = use_begin(), E = use_end(); |
| 83 | |
| 84 | for (; N; --N, ++UI) |
| 85 | if (UI == E) return false; // Too few. |
| 86 | |
| 87 | return true; |
| 88 | } |
| 89 | |
| 90 | |
Chris Lattner | 29d1ca6 | 2005-02-01 01:24:21 +0000 | [diff] [blame] | 91 | /// getNumUses - This method computes the number of uses of this Value. This |
| 92 | /// is a linear time operation. Use hasOneUse or hasNUses to check for specific |
| 93 | /// values. |
| 94 | unsigned Value::getNumUses() const { |
| 95 | return (unsigned)std::distance(use_begin(), use_end()); |
| 96 | } |
| 97 | |
Chris Lattner | 7216811 | 2007-02-11 00:37:27 +0000 | [diff] [blame] | 98 | static bool getSymTab(Value *V, ValueSymbolTable *&ST) { |
Chris Lattner | ea7acb8 | 2007-02-11 19:12:18 +0000 | [diff] [blame] | 99 | ST = 0; |
Chris Lattner | 7216811 | 2007-02-11 00:37:27 +0000 | [diff] [blame] | 100 | if (Instruction *I = dyn_cast<Instruction>(V)) { |
| 101 | if (BasicBlock *P = I->getParent()) |
| 102 | if (Function *PP = P->getParent()) |
| 103 | ST = &PP->getValueSymbolTable(); |
| 104 | } else if (BasicBlock *BB = dyn_cast<BasicBlock>(V)) { |
| 105 | if (Function *P = BB->getParent()) |
| 106 | ST = &P->getValueSymbolTable(); |
| 107 | } else if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) { |
| 108 | if (Module *P = GV->getParent()) |
| 109 | ST = &P->getValueSymbolTable(); |
| 110 | } else if (Argument *A = dyn_cast<Argument>(V)) { |
| 111 | if (Function *P = A->getParent()) |
| 112 | ST = &P->getValueSymbolTable(); |
| 113 | } else { |
| 114 | assert(isa<Constant>(V) && "Unknown value type!"); |
| 115 | return true; // no name is setable for this. |
| 116 | } |
| 117 | return false; |
| 118 | } |
Chris Lattner | 28eca8b | 2002-10-09 23:12:59 +0000 | [diff] [blame] | 119 | |
Chris Lattner | 71996e7 | 2007-08-10 15:34:35 +0000 | [diff] [blame] | 120 | /// getNameStart - Return a pointer to a null terminated string for this name. |
| 121 | /// Note that names can have null characters within the string as well as at |
| 122 | /// their end. This always returns a non-null pointer. |
| 123 | const char *Value::getNameStart() const { |
| 124 | if (Name == 0) return ""; |
| 125 | return Name->getKeyData(); |
| 126 | } |
| 127 | |
| 128 | /// getNameLen - Return the length of the string, correctly handling nul |
| 129 | /// characters embedded into them. |
| 130 | unsigned Value::getNameLen() const { |
Chris Lattner | d7c4ca1 | 2007-09-28 20:09:40 +0000 | [diff] [blame] | 131 | return Name ? Name->getKeyLength() : 0; |
Chris Lattner | 71996e7 | 2007-08-10 15:34:35 +0000 | [diff] [blame] | 132 | } |
| 133 | |
| 134 | |
Chris Lattner | 924b1ca | 2007-02-15 18:53:54 +0000 | [diff] [blame] | 135 | std::string Value::getNameStr() const { |
Chris Lattner | dec628e | 2007-02-12 05:18:08 +0000 | [diff] [blame] | 136 | if (Name == 0) return ""; |
| 137 | return std::string(Name->getKeyData(), |
| 138 | Name->getKeyData()+Name->getKeyLength()); |
| 139 | } |
Chris Lattner | 0d1e407 | 2005-03-05 19:51:50 +0000 | [diff] [blame] | 140 | |
Chris Lattner | dec628e | 2007-02-12 05:18:08 +0000 | [diff] [blame] | 141 | void Value::setName(const std::string &name) { |
Chris Lattner | 042ad36 | 2007-02-12 18:52:59 +0000 | [diff] [blame] | 142 | setName(&name[0], name.size()); |
| 143 | } |
| 144 | |
Chris Lattner | ec79b3d | 2007-02-13 07:53:34 +0000 | [diff] [blame] | 145 | void Value::setName(const char *Name) { |
| 146 | setName(Name, Name ? strlen(Name) : 0); |
| 147 | } |
| 148 | |
Chris Lattner | 042ad36 | 2007-02-12 18:52:59 +0000 | [diff] [blame] | 149 | void Value::setName(const char *NameStr, unsigned NameLen) { |
| 150 | if (NameLen == 0 && !hasName()) return; |
Jeff Cohen | ca5183d | 2007-03-05 00:00:42 +0000 | [diff] [blame] | 151 | assert(getType() != Type::VoidTy && "Cannot assign a name to void values!"); |
Chris Lattner | dec628e | 2007-02-12 05:18:08 +0000 | [diff] [blame] | 152 | |
Chris Lattner | 04cb800 | 2005-03-06 02:14:28 +0000 | [diff] [blame] | 153 | // Get the symbol table to update for this object. |
Chris Lattner | 7216811 | 2007-02-11 00:37:27 +0000 | [diff] [blame] | 154 | ValueSymbolTable *ST; |
| 155 | if (getSymTab(this, ST)) |
| 156 | return; // Cannot set a name on this value (e.g. constant). |
Chris Lattner | 0d1e407 | 2005-03-05 19:51:50 +0000 | [diff] [blame] | 157 | |
Chris Lattner | dec628e | 2007-02-12 05:18:08 +0000 | [diff] [blame] | 158 | if (!ST) { // No symbol table to update? Just do the change. |
Chris Lattner | 042ad36 | 2007-02-12 18:52:59 +0000 | [diff] [blame] | 159 | if (NameLen == 0) { |
Chris Lattner | dec628e | 2007-02-12 05:18:08 +0000 | [diff] [blame] | 160 | // Free the name for this value. |
| 161 | Name->Destroy(); |
| 162 | Name = 0; |
Chris Lattner | 042ad36 | 2007-02-12 18:52:59 +0000 | [diff] [blame] | 163 | return; |
Chris Lattner | 04cb800 | 2005-03-06 02:14:28 +0000 | [diff] [blame] | 164 | } |
Chris Lattner | 042ad36 | 2007-02-12 18:52:59 +0000 | [diff] [blame] | 165 | |
| 166 | if (Name) { |
| 167 | // Name isn't changing? |
| 168 | if (NameLen == Name->getKeyLength() && |
| 169 | !memcmp(Name->getKeyData(), NameStr, NameLen)) |
| 170 | return; |
| 171 | Name->Destroy(); |
| 172 | } |
| 173 | |
| 174 | // NOTE: Could optimize for the case the name is shrinking to not deallocate |
| 175 | // then reallocated. |
| 176 | |
| 177 | // Create the new name. |
| 178 | Name = ValueName::Create(NameStr, NameStr+NameLen); |
| 179 | Name->setValue(this); |
Chris Lattner | dec628e | 2007-02-12 05:18:08 +0000 | [diff] [blame] | 180 | return; |
Chris Lattner | 04cb800 | 2005-03-06 02:14:28 +0000 | [diff] [blame] | 181 | } |
Chris Lattner | dec628e | 2007-02-12 05:18:08 +0000 | [diff] [blame] | 182 | |
| 183 | // NOTE: Could optimize for the case the name is shrinking to not deallocate |
| 184 | // then reallocated. |
| 185 | if (hasName()) { |
| 186 | // Name isn't changing? |
Chris Lattner | 042ad36 | 2007-02-12 18:52:59 +0000 | [diff] [blame] | 187 | if (NameLen == Name->getKeyLength() && |
| 188 | !memcmp(Name->getKeyData(), NameStr, NameLen)) |
Chris Lattner | dec628e | 2007-02-12 05:18:08 +0000 | [diff] [blame] | 189 | return; |
| 190 | |
| 191 | // Remove old name. |
| 192 | ST->removeValueName(Name); |
| 193 | Name->Destroy(); |
| 194 | Name = 0; |
| 195 | |
Chris Lattner | 042ad36 | 2007-02-12 18:52:59 +0000 | [diff] [blame] | 196 | if (NameLen == 0) |
| 197 | return; |
Chris Lattner | dec628e | 2007-02-12 05:18:08 +0000 | [diff] [blame] | 198 | } |
| 199 | |
| 200 | // Name is changing to something new. |
Chris Lattner | 042ad36 | 2007-02-12 18:52:59 +0000 | [diff] [blame] | 201 | Name = ST->createValueName(NameStr, NameLen, this); |
Chris Lattner | 0d1e407 | 2005-03-05 19:51:50 +0000 | [diff] [blame] | 202 | } |
| 203 | |
Chris Lattner | 042ad36 | 2007-02-12 18:52:59 +0000 | [diff] [blame] | 204 | |
Chris Lattner | 7216811 | 2007-02-11 00:37:27 +0000 | [diff] [blame] | 205 | /// takeName - transfer the name from V to this value, setting V's name to |
| 206 | /// empty. It is an error to call V->takeName(V). |
| 207 | void Value::takeName(Value *V) { |
Chris Lattner | 0878c31 | 2007-02-15 20:01:43 +0000 | [diff] [blame] | 208 | ValueSymbolTable *ST = 0; |
| 209 | // If this value has a name, drop it. |
| 210 | if (hasName()) { |
| 211 | // Get the symtab this is in. |
| 212 | if (getSymTab(this, ST)) { |
| 213 | // We can't set a name on this value, but we need to clear V's name if |
| 214 | // it has one. |
| 215 | if (V->hasName()) V->setName(0, 0); |
| 216 | return; // Cannot set a name on this value (e.g. constant). |
| 217 | } |
| 218 | |
| 219 | // Remove old name. |
| 220 | if (ST) |
| 221 | ST->removeValueName(Name); |
| 222 | Name->Destroy(); |
| 223 | Name = 0; |
| 224 | } |
| 225 | |
| 226 | // Now we know that this has no name. |
| 227 | |
| 228 | // If V has no name either, we're done. |
| 229 | if (!V->hasName()) return; |
| 230 | |
| 231 | // Get this's symtab if we didn't before. |
| 232 | if (!ST) { |
| 233 | if (getSymTab(this, ST)) { |
| 234 | // Clear V's name. |
| 235 | V->setName(0, 0); |
| 236 | return; // Cannot set a name on this value (e.g. constant). |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | // Get V's ST, this should always succed, because V has a name. |
| 241 | ValueSymbolTable *VST; |
| 242 | bool Failure = getSymTab(V, VST); |
| 243 | assert(!Failure && "V has a name, so it should have a ST!"); |
| 244 | |
| 245 | // If these values are both in the same symtab, we can do this very fast. |
| 246 | // This works even if both values have no symtab yet. |
| 247 | if (ST == VST) { |
| 248 | // Take the name! |
| 249 | Name = V->Name; |
| 250 | V->Name = 0; |
| 251 | Name->setValue(this); |
Chris Lattner | f41916e | 2007-02-11 01:04:09 +0000 | [diff] [blame] | 252 | return; |
| 253 | } |
| 254 | |
Chris Lattner | 0878c31 | 2007-02-15 20:01:43 +0000 | [diff] [blame] | 255 | // Otherwise, things are slightly more complex. Remove V's name from VST and |
| 256 | // then reinsert it into ST. |
| 257 | |
| 258 | if (VST) |
| 259 | VST->removeValueName(V->Name); |
| 260 | Name = V->Name; |
| 261 | V->Name = 0; |
| 262 | Name->setValue(this); |
| 263 | |
| 264 | if (ST) |
| 265 | ST->reinsertValue(this); |
Chris Lattner | 7216811 | 2007-02-11 00:37:27 +0000 | [diff] [blame] | 266 | } |
| 267 | |
| 268 | |
Chris Lattner | 2bc065b | 2003-08-29 05:09:37 +0000 | [diff] [blame] | 269 | // uncheckedReplaceAllUsesWith - This is exactly the same as replaceAllUsesWith, |
| 270 | // except that it doesn't have all of the asserts. The asserts fail because we |
| 271 | // are half-way done resolving types, which causes some types to exist as two |
| 272 | // different Type*'s at the same time. This is a sledgehammer to work around |
| 273 | // this problem. |
| 274 | // |
| 275 | void Value::uncheckedReplaceAllUsesWith(Value *New) { |
Chris Lattner | 29d1ca6 | 2005-02-01 01:24:21 +0000 | [diff] [blame] | 276 | while (!use_empty()) { |
| 277 | Use &U = *UseList; |
Chris Lattner | 2bc065b | 2003-08-29 05:09:37 +0000 | [diff] [blame] | 278 | // Must handle Constants specially, we cannot call replaceUsesOfWith on a |
Chris Lattner | 2d69133 | 2007-08-21 00:21:07 +0000 | [diff] [blame] | 279 | // constant because they are uniqued. |
Chris Lattner | c3cc71a | 2003-10-16 16:53:07 +0000 | [diff] [blame] | 280 | if (Constant *C = dyn_cast<Constant>(U.getUser())) { |
Chris Lattner | 2d69133 | 2007-08-21 00:21:07 +0000 | [diff] [blame] | 281 | if (!isa<GlobalValue>(C)) { |
Chris Lattner | d0ff1ad | 2005-10-04 18:13:04 +0000 | [diff] [blame] | 282 | C->replaceUsesOfWithOnConstant(this, New, &U); |
Chris Lattner | 2d69133 | 2007-08-21 00:21:07 +0000 | [diff] [blame] | 283 | continue; |
| 284 | } |
Chris Lattner | 2bc065b | 2003-08-29 05:09:37 +0000 | [diff] [blame] | 285 | } |
Chris Lattner | 2d69133 | 2007-08-21 00:21:07 +0000 | [diff] [blame] | 286 | |
| 287 | U.set(New); |
Chris Lattner | 2bc065b | 2003-08-29 05:09:37 +0000 | [diff] [blame] | 288 | } |
| 289 | } |
| 290 | |
Chris Lattner | c3cc71a | 2003-10-16 16:53:07 +0000 | [diff] [blame] | 291 | void Value::replaceAllUsesWith(Value *New) { |
| 292 | assert(New && "Value::replaceAllUsesWith(<null>) is invalid!"); |
| 293 | assert(New != this && "this->replaceAllUsesWith(this) is NOT valid!"); |
| 294 | assert(New->getType() == getType() && |
| 295 | "replaceAllUses of value with new value of different type!"); |
Chris Lattner | 2bc065b | 2003-08-29 05:09:37 +0000 | [diff] [blame] | 296 | |
Chris Lattner | c3cc71a | 2003-10-16 16:53:07 +0000 | [diff] [blame] | 297 | uncheckedReplaceAllUsesWith(New); |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 298 | } |
| 299 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 300 | //===----------------------------------------------------------------------===// |
| 301 | // User Class |
| 302 | //===----------------------------------------------------------------------===// |
| 303 | |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 304 | // replaceUsesOfWith - Replaces all references to the "From" definition with |
| 305 | // references to the "To" definition. |
| 306 | // |
| 307 | void User::replaceUsesOfWith(Value *From, Value *To) { |
| 308 | if (From == To) return; // Duh what? |
| 309 | |
Reid Spencer | 4ec2e4c | 2004-07-18 00:01:50 +0000 | [diff] [blame] | 310 | assert(!isa<Constant>(this) || isa<GlobalValue>(this) && |
Chris Lattner | 28eca8b | 2002-10-09 23:12:59 +0000 | [diff] [blame] | 311 | "Cannot call User::replaceUsesofWith on a constant!"); |
| 312 | |
Chris Lattner | c8b25d4 | 2001-07-07 08:36:50 +0000 | [diff] [blame] | 313 | for (unsigned i = 0, E = getNumOperands(); i != E; ++i) |
| 314 | if (getOperand(i) == From) { // Is This operand is pointing to oldval? |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 315 | // The side effects of this setOperand call include linking to |
| 316 | // "To", adding "this" to the uses list of To, and |
| 317 | // most importantly, removing "this" from the use list of "From". |
Chris Lattner | c8b25d4 | 2001-07-07 08:36:50 +0000 | [diff] [blame] | 318 | setOperand(i, To); // Fix it now... |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 319 | } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 320 | } |
Reid Spencer | 4ec2e4c | 2004-07-18 00:01:50 +0000 | [diff] [blame] | 321 | |