summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-14 03:30:23 +0000
committerChris Lattner <sabre@nondot.org>2002-10-14 03:30:23 +0000
commit163b890dfb7811e2ff473d548570823c63d4d598 (patch)
tree143d59f245e43ea4f78bce9e02218b500783da63 /llvm/include
parent8022a0f57cc863c34bf11ebe46562ce12b01c6ae (diff)
downloadbcm5719-llvm-163b890dfb7811e2ff473d548570823c63d4d598.tar.gz
bcm5719-llvm-163b890dfb7811e2ff473d548570823c63d4d598.zip
- Dramatically simplify the Constant::mutateReferences implementation,
allowing it to be called on all constant types (structures/arrays) llvm-svn: 4160
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Constant.h2
-rw-r--r--llvm/include/llvm/Constants.h14
-rw-r--r--llvm/include/llvm/Module.h3
3 files changed, 3 insertions, 16 deletions
diff --git a/llvm/include/llvm/Constant.h b/llvm/include/llvm/Constant.h
index 3105cea319d..a7ec6331bd5 100644
--- a/llvm/include/llvm/Constant.h
+++ b/llvm/include/llvm/Constant.h
@@ -79,7 +79,7 @@ public:
// WARNING: Only to be used by Bytecode & Assembly Parsers! USER CODE SHOULD
// NOT USE THIS!!
// Returns the number of uses of OldV that were replaced.
- virtual unsigned mutateReferences(Value* OldV, Value *NewV) { return 0; }
+ unsigned mutateReferences(Value* OldV, Value *NewV);
// END WARNING!!
};
diff --git a/llvm/include/llvm/Constants.h b/llvm/include/llvm/Constants.h
index a91c1971fa4..ec6345846e3 100644
--- a/llvm/include/llvm/Constants.h
+++ b/llvm/include/llvm/Constants.h
@@ -439,12 +439,6 @@ public:
static inline bool classof(const Value *V) {
return isa<ConstantPointer>(V) && classof(cast<ConstantPointer>(V));
}
-
- // WARNING: Only to be used by Bytecode & Assembly Parsers! USER CODE SHOULD
- // NOT USE THIS!!
- // Returns the number of uses of OldV that were replaced.
- virtual unsigned mutateReferences(Value* OldV, Value *NewV);
- // END WARNING!!
};
@@ -502,14 +496,6 @@ public:
static inline bool classof(const Value *V) {
return isa<Constant>(V) && classof(cast<Constant>(V));
}
-
-public:
- // WARNING: Only to be used by Bytecode & Assembly Parsers! USER CODE SHOULD
- // NOT USE THIS!!
- // Returns the number of uses of OldV that were replaced.
- virtual unsigned mutateReferences(Value* OldV, Value *NewV);
- // END WARNING!!
};
-
#endif
diff --git a/llvm/include/llvm/Module.h b/llvm/include/llvm/Module.h
index b34c06b9f57..2b8c0ab5d0e 100644
--- a/llvm/include/llvm/Module.h
+++ b/llvm/include/llvm/Module.h
@@ -59,7 +59,8 @@ private:
SymbolTable *SymTab;
// Accessor for the underlying GlobalValRefMap... only through the
- // ConstantPointerRef class...
+ // Constant class...
+ friend class Constant;
friend class ConstantPointerRef;
void mutateConstantPointerRef(GlobalValue *OldGV, GlobalValue *NewGV);
ConstantPointerRef *getConstantPointerRef(GlobalValue *GV);
OpenPOWER on IntegriCloud