summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-16 22:11:26 +0000
committerOwen Anderson <resistor@mac.com>2009-07-16 22:11:26 +0000
commitaad3fb7362aff151e97ad457005ea3f2872fe868 (patch)
tree78ad3b3efe4d503fc275adfe42a0102d52a78587 /include/llvm
parent24cd3c4711333ca1e07cbdb34475bccfeb762bb6 (diff)
downloadllvm-aad3fb7362aff151e97ad457005ea3f2872fe868.tar.gz
llvm-aad3fb7362aff151e97ad457005ea3f2872fe868.tar.bz2
llvm-aad3fb7362aff151e97ad457005ea3f2872fe868.tar.xz
Privatize the MDString uniquing table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Constant.h1
-rw-r--r--include/llvm/Constants.h6
-rw-r--r--include/llvm/LLVMContext.h3
3 files changed, 5 insertions, 5 deletions
diff --git a/include/llvm/Constant.h b/include/llvm/Constant.h
index 3dc5881bdf..62b75a77fb 100644
--- a/include/llvm/Constant.h
+++ b/include/llvm/Constant.h
@@ -54,6 +54,7 @@ namespace llvm {
class Constant : public User {
void operator=(const Constant &); // Do not implement
Constant(const Constant &); // Do not implement
+
protected:
Constant(const Type *ty, ValueTy vty, Use *Ops, unsigned NumOps)
: User(ty, vty, Ops, NumOps) {}
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index 199355baf4..487dd6732a 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -745,17 +745,13 @@ class MDString : public Constant {
MDString(const char *begin, const char *end);
const char *StrBegin, *StrEnd;
+ friend class LLVMContextImpl;
protected:
// allocate space for exactly zero operands
void *operator new(size_t s) {
return User::operator new(s, 0);
}
public:
- /// get() - Static factory methods - Return objects of the specified value.
- ///
- static MDString *get(const char *StrBegin, const char *StrEnd);
- static MDString *get(const std::string &Str);
-
/// size() - The length of this string.
///
intptr_t size() const { return StrEnd - StrBegin; }
diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h
index 4aa2c20ec2..75789182f6 100644
--- a/include/llvm/LLVMContext.h
+++ b/include/llvm/LLVMContext.h
@@ -268,6 +268,9 @@ public:
// Other helpers
/// @brief Create a result type for fcmp/icmp
const Type* makeCmpResultType(const Type* opnd_type);
+
+ // Methods for erasing constants
+ void erase(MDString *M);
};
/// FOR BACKWARDS COMPATIBILITY - Returns a global context.