summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lli/lli.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-06-08 10:01:20 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-06-08 10:01:20 +0000
commit46e38f36785508dc6f90e642c68e4a72a493e8f5 (patch)
tree290f0903a81451736d6c920ef4b50bba0e995325 /llvm/tools/lli/lli.cpp
parentacadc8e0d64e90cded8f63a154ab3111a1d294f9 (diff)
downloadbcm5719-llvm-46e38f36785508dc6f90e642c68e4a72a493e8f5.tar.gz
bcm5719-llvm-46e38f36785508dc6f90e642c68e4a72a493e8f5.zip
Avoid copies of std::strings and APInt/APFloats where we only read from it
As suggested by clang-tidy's performance-unnecessary-copy-initialization. This can easily hit lifetime issues, so I audited every change and ran the tests under asan, which came back clean. llvm-svn: 272126
Diffstat (limited to 'llvm/tools/lli/lli.cpp')
-rw-r--r--llvm/tools/lli/lli.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index 28232478217..868fc16cd7f 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -254,7 +254,7 @@ public:
~LLIObjectCache() override {}
void notifyObjectCompiled(const Module *M, MemoryBufferRef Obj) override {
- const std::string ModuleID = M->getModuleIdentifier();
+ const std::string &ModuleID = M->getModuleIdentifier();
std::string CacheName;
if (!getCacheFilename(ModuleID, CacheName))
return;
@@ -269,7 +269,7 @@ public:
}
std::unique_ptr<MemoryBuffer> getObject(const Module* M) override {
- const std::string ModuleID = M->getModuleIdentifier();
+ const std::string &ModuleID = M->getModuleIdentifier();
std::string CacheName;
if (!getCacheFilename(ModuleID, CacheName))
return nullptr;
OpenPOWER on IntegriCloud