summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2017-08-29 05:22:26 +0000
committerSerge Pavlov <sepavloff@gmail.com>2017-08-29 05:22:26 +0000
commit4e769847c28af252f1ec70d670ea463e01dddf22 (patch)
tree4c6052f67f041cc1ca28560df1591acbecf19311 /clang/lib/Tooling
parent03407da281ccef3b925935b33f1d7e397b303efc (diff)
downloadbcm5719-llvm-4e769847c28af252f1ec70d670ea463e01dddf22.tar.gz
bcm5719-llvm-4e769847c28af252f1ec70d670ea463e01dddf22.zip
Use class to pass information about executable name
Information about clang executable name components, such as target and driver mode, was passes in std::pair. With this change it is passed in a special structure. It improves readability and makes access to this information more convenient. NFC. Differential Revision: https://reviews.llvm.org/D36057 llvm-svn: 311981
Diffstat (limited to 'clang/lib/Tooling')
-rw-r--r--clang/lib/Tooling/Tooling.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Tooling/Tooling.cpp b/clang/lib/Tooling/Tooling.cpp
index 662f02dca2a..df9d7df6948 100644
--- a/clang/lib/Tooling/Tooling.cpp
+++ b/clang/lib/Tooling/Tooling.cpp
@@ -190,11 +190,12 @@ void addTargetAndModeForProgramName(std::vector<std::string> &CommandLine,
}
auto TargetMode =
clang::driver::ToolChain::getTargetAndModeFromProgramName(InvokedAs);
- if (!AlreadyHasMode && !TargetMode.second.empty()) {
- CommandLine.insert(++CommandLine.begin(), TargetMode.second);
+ if (!AlreadyHasMode && TargetMode.DriverMode) {
+ CommandLine.insert(++CommandLine.begin(), TargetMode.DriverMode);
}
- if (!AlreadyHasTarget && !TargetMode.first.empty()) {
- CommandLine.insert(++CommandLine.begin(), {"-target", TargetMode.first});
+ if (!AlreadyHasTarget && TargetMode.TargetIsValid) {
+ CommandLine.insert(++CommandLine.begin(), {"-target",
+ TargetMode.TargetPrefix});
}
}
}
OpenPOWER on IntegriCloud