summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-11-13 23:59:16 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-11-13 23:59:16 +0000
commit77349e7aaf32a9214b42e1669e272e51f0fede28 (patch)
treebb4f2c9cf4465e663b653b4407d1c21077bc990f
parent01e87d3fe2423640d2f133ffeb150204db50af07 (diff)
downloadbcm5719-llvm-77349e7aaf32a9214b42e1669e272e51f0fede28.tar.gz
bcm5719-llvm-77349e7aaf32a9214b42e1669e272e51f0fede28.zip
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
-rw-r--r--llvm/include/llvm/IR/Metadata.h5
-rw-r--r--llvm/lib/Transforms/Vectorize/LoopVectorize.cpp2
2 files changed, 6 insertions, 1 deletions
diff --git a/llvm/include/llvm/IR/Metadata.h b/llvm/include/llvm/IR/Metadata.h
index a4e9f532980..36b1e063cb9 100644
--- a/llvm/include/llvm/IR/Metadata.h
+++ b/llvm/include/llvm/IR/Metadata.h
@@ -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) {
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 20e7ce63abf..5681a1e3608 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -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;
}
OpenPOWER on IntegriCloud