IR: Make MDString::getName() private

Hide the fact that `MDString`'s string is stored in `Value::Name` --
that's going to change soon.  Update the only in-tree client that was
using it instead of `Value::getString()`.

Part of PR21532.

llvm-svn: 221951
This commit is contained in:
Duncan P. N. Exon Smith 2014-11-13 23:59:16 +00:00
parent 01e87d3fe2
commit 77349e7aaf
2 changed files with 6 additions and 1 deletions

View File

@ -61,6 +61,11 @@ class MDString : public Value {
MDString(const MDString &) LLVM_DELETED_FUNCTION;
explicit MDString(LLVMContext &C);
private:
/// \brief Shadow Value::getName() to prevent its use.
StringRef getName() const { return Value::getName(); }
public:
static MDString *get(LLVMContext &Context, StringRef Str);
static MDString *get(LLVMContext &Context, const char *Str) {

View File

@ -1159,7 +1159,7 @@ private:
return false;
for (auto H : HintTypes)
if (Name->getName().endswith(H.Name))
if (Name->getString().endswith(H.Name))
return true;
return false;
}