diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-18 10:56:38 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-18 10:56:38 +0000 |
commit | 04468962ab332822dc6032344d94ea0c1244046e (patch) | |
tree | cb57ce266b1ec65eba230344447d98f35c7a882a /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 51794a390fe1c29ec14947289b9ff338a95d433b (diff) | |
download | llvm-04468962ab332822dc6032344d94ea0c1244046e.zip llvm-04468962ab332822dc6032344d94ea0c1244046e.tar.gz llvm-04468962ab332822dc6032344d94ea0c1244046e.tar.bz2 |
Reduce penalty for splitting between ")" and ".".
').' is likely part of a builder pattern statement.
This is based upon a patch developed by Nico Weber. Thank you!
Before:
int foo() {
return llvm::StringSwitch<Reference::Kind>(name).StartsWith(
".eh_frame_hdr", ORDER_EH_FRAMEHDR).StartsWith(
".eh_frame", ORDER_EH_FRAME).StartsWith(".init", ORDER_INIT).StartsWith(
".fini", ORDER_FINI).StartsWith(".hash", ORDER_HASH).Default(ORDER_TEXT);
}
After:
int foo() {
return llvm::StringSwitch<Reference::Kind>(name)
.StartsWith(".eh_frame_hdr", ORDER_EH_FRAMEHDR)
.StartsWith(".eh_frame", ORDER_EH_FRAME)
.StartsWith(".init", ORDER_INIT).StartsWith(".fini", ORDER_FINI)
.StartsWith(".hash", ORDER_HASH).Default(ORDER_TEXT);
}
Probably not ideal, but makes many cases much more readable.
The changes to overriding-ftemplate-comments.cpp don't seem better or
worse. We should address those soon.
llvm-svn: 172804
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions