summaryrefslogtreecommitdiffstats
path: root/lld/include
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-04-25 21:44:37 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-04-25 21:44:37 +0000
commit1eeb26293d76039094406f43c7339986a622cfb0 (patch)
treef002421ac32c400a29396d182ea315daf79cba50 /lld/include
parented8b8fdcc2e6959bbe4f0a0ce39ab49617ba6a4d (diff)
downloadbcm5719-llvm-1eeb26293d76039094406f43c7339986a622cfb0.tar.gz
bcm5719-llvm-1eeb26293d76039094406f43c7339986a622cfb0.zip
Pack symbols a bit more.
Before this patch: Symbol 56 Defined 80 Undefined 56 SharedSymbol 88 LazyArchive 72 LazyObject 56 With this patch Symbol 48 Defined 72 Undefined 48 SharedSymbol 80 LazyArchive 64 LazyObject 48 The result is that peak allocation when linking chromium (according to heaptrack) goes from 578 to 568 MB. llvm-svn: 330874
Diffstat (limited to 'lld/include')
-rw-r--r--lld/include/lld/Common/Strings.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lld/include/lld/Common/Strings.h b/lld/include/lld/Common/Strings.h
index 3be5eb952d5..9b1469a3b82 100644
--- a/lld/include/lld/Common/Strings.h
+++ b/lld/include/lld/Common/Strings.h
@@ -45,6 +45,9 @@ public:
/*implicit*/ StringRefZ(llvm::StringRef S)
: Start(S.data()), Size(S.size()) {}
+ const char *data() const { return Start; }
+ size_t rawSize() const { return Size; };
+
operator llvm::StringRef() const {
if (Size == (size_t)-1)
Size = strlen(Start);
OpenPOWER on IntegriCloud