DataLayout now returns a const ref to its member string representation
[oota-llvm.git] / include / llvm / IR / DataLayout.h
index 3e1f9744f9e8139c7fe2b83aa1b18f3b154979ec..892d6c9936c03958a86a8c58c7ba4a283799eff4 100644 (file)
@@ -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(); }