aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2018-01-16 20:52:32 +0000
committerRui Ueyama <ruiu@google.com>2018-01-16 20:52:32 +0000
commitaf4ddd5a6e9c99e46cb87e98cadc08a676a98e1d (patch)
treed6fdd8d7f3c392952f26e9a3938b8f3413e11189 /llvm/lib/Support/CommandLine.cpp
parent4a793c06676feb4f8e27c9f347bf2487670b71cc (diff)
downloadllvm-af4ddd5a6e9c99e46cb87e98cadc08a676a98e1d.zip
llvm-af4ddd5a6e9c99e46cb87e98cadc08a676a98e1d.tar.gz
llvm-af4ddd5a6e9c99e46cb87e98cadc08a676a98e1d.tar.bz2
Specify inline for isWhitespace in CommandLine.cpp
Patch by Takuto Ikuta. In chromium's component build, there are many directive sections and commandline parsing takes much time. This patch is for speed up of lld in RelWithDebInfo build by forcing inline heavily called isWhitespace function. 10 times link perf stats of blink_core.dll changed like below. master: TotalSeconds: 9.8764878 TotalSeconds: 10.1455242 TotalSeconds: 10.075279 TotalSeconds: 10.3397347 TotalSeconds: 9.8361665 TotalSeconds: 9.9544441 TotalSeconds: 9.8960686 TotalSeconds: 9.8877865 TotalSeconds: 10.0551879 TotalSeconds: 10.0492254 Avg: 10.01159047 with this patch: TotalSeconds: 8.8696762 TotalSeconds: 9.1021585 TotalSeconds: 9.0233893 TotalSeconds: 9.1886175 TotalSeconds: 9.156954 TotalSeconds: 9.0978564 TotalSeconds: 9.1316824 TotalSeconds: 8.8354606 TotalSeconds: 9.2549431 TotalSeconds: 9.4473085 Avg: 9.11080465 llvm-svn: 322595
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r--llvm/lib/Support/CommandLine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index d95b791..451c3f4 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -688,7 +688,7 @@ static bool EatsUnboundedNumberOfValues(const Option *O) {
O->getNumOccurrencesFlag() == cl::OneOrMore;
}
-static bool isWhitespace(char C) {
+static inline bool isWhitespace(char C) {
return C == ' ' || C == '\t' || C == '\r' || C == '\n';
}