summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/IR/DataLayout.h4
-rw-r--r--llvm/include/llvm/IR/Module.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/llvm/include/llvm/IR/DataLayout.h b/llvm/include/llvm/IR/DataLayout.h
index 3e1f9744f9e..892d6c9936c 100644
--- a/llvm/include/llvm/IR/DataLayout.h
+++ b/llvm/include/llvm/IR/DataLayout.h
@@ -222,7 +222,9 @@ public:
/// This representation is in the same format accepted by the string
/// constructor above. This should not be used to compare two DataLayout as
/// different string can represent the same layout.
- std::string getStringRepresentation() const { return StringRepresentation; }
+ const std::string &getStringRepresentation() const {
+ return StringRepresentation;
+ }
/// \brief Test if the DataLayout was constructed from an empty string.
bool isDefault() const { return StringRepresentation.empty(); }
diff --git a/llvm/include/llvm/IR/Module.h b/llvm/include/llvm/IR/Module.h
index 4bc03fb574f..1668b95c8bd 100644
--- a/llvm/include/llvm/IR/Module.h
+++ b/llvm/include/llvm/IR/Module.h
@@ -249,7 +249,7 @@ public:
/// Get the data layout string for the module's target platform. This is
/// equivalent to getDataLayout()->getStringRepresentation().
- const std::string getDataLayoutStr() const {
+ const std::string &getDataLayoutStr() const {
return DL.getStringRepresentation();
}
OpenPOWER on IntegriCloud