destroyConstantImpl();
}
-void ConstantAggregateZero::replaceUsesOfWithOnConstant(Value *From, Value *To,
- bool DisableChecking) {
- assert(0 && "No uses!");
- abort();
-}
-
-
-
//---- ConstantArray::get() implementation...
//
namespace llvm {
// replaceUsesOfWithOnConstant implementations
void ConstantArray::replaceUsesOfWithOnConstant(Value *From, Value *To,
- bool DisableChecking) {
+ Use *U) {
assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!");
Constant *ToC = cast<Constant>(To);
// Otherwise, I do need to replace this with an existing value.
assert(Replacement != this && "I didn't contain From!");
- // Everyone using this now uses the replacement...
- if (DisableChecking)
- uncheckedReplaceAllUsesWith(Replacement);
- else
- replaceAllUsesWith(Replacement);
+ // Everyone using this now uses the replacement.
+ uncheckedReplaceAllUsesWith(Replacement);
// Delete the old constant!
destroyConstant();
}
void ConstantStruct::replaceUsesOfWithOnConstant(Value *From, Value *To,
- bool DisableChecking) {
+ Use *U) {
assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!");
Constant *ToC = cast<Constant>(To);
assert(Replacement != this && "I didn't contain From!");
- // Everyone using this now uses the replacement...
- if (DisableChecking)
- uncheckedReplaceAllUsesWith(Replacement);
- else
- replaceAllUsesWith(Replacement);
+ // Everyone using this now uses the replacement.
+ uncheckedReplaceAllUsesWith(Replacement);
// Delete the old constant!
destroyConstant();
}
void ConstantPacked::replaceUsesOfWithOnConstant(Value *From, Value *To,
- bool DisableChecking) {
+ Use *U) {
assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!");
std::vector<Constant*> Values;
Constant *Replacement = ConstantPacked::get(getType(), Values);
assert(Replacement != this && "I didn't contain From!");
- // Everyone using this now uses the replacement...
- if (DisableChecking)
- uncheckedReplaceAllUsesWith(Replacement);
- else
- replaceAllUsesWith(Replacement);
+ // Everyone using this now uses the replacement.
+ uncheckedReplaceAllUsesWith(Replacement);
// Delete the old constant!
destroyConstant();
}
void ConstantExpr::replaceUsesOfWithOnConstant(Value *From, Value *ToV,
- bool DisableChecking) {
+ Use *U) {
assert(isa<Constant>(ToV) && "Cannot make Constant refer to non-constant!");
Constant *To = cast<Constant>(ToV);
assert(Replacement != this && "I didn't contain From!");
- // Everyone using this now uses the replacement...
- if (DisableChecking)
- uncheckedReplaceAllUsesWith(Replacement);
- else
- replaceAllUsesWith(Replacement);
+ // Everyone using this now uses the replacement.
+ uncheckedReplaceAllUsesWith(Replacement);
// Delete the old constant!
destroyConstant();