diff --git a/include/swift/Reflection/TypeRef.h b/include/swift/Reflection/TypeRef.h index 2557b883c5e..7d7b33b7d87 100644 --- a/include/swift/Reflection/TypeRef.h +++ b/include/swift/Reflection/TypeRef.h @@ -87,7 +87,7 @@ public: return std::make_shared(MangledName); } - std::string getMangledName() const { + const std::string &getMangledName() const { return MangledName; } @@ -109,7 +109,7 @@ public: return std::make_shared(MangledName, Parent); } - std::string getMangledName() const { + const std::string &getMangledName() const { return MangledName; } @@ -152,7 +152,7 @@ public: Parent); } - std::string getMangledName() const { + const std::string &getMangledName() const { return MangledName; } @@ -249,11 +249,11 @@ public: return std::make_shared(ModuleName, Name); } - std::string getName() const { + const std::string &getName() const { return Name; } - std::string getModuleName() const { + const std::string &getModuleName() const { return ModuleName; } @@ -412,7 +412,7 @@ public: : TypeRef(TypeRefKind::ForeignClass), Name(Name) {} static const std::shared_ptr Unnamed; - std::string getName() const { + const std::string &getName() const { return Name; } @@ -428,7 +428,7 @@ public: : TypeRef(TypeRefKind::ObjCClass), Name(Name) {} static const std::shared_ptr Unnamed; - std::string getName() const { + const std::string &getName() const { return Name; }