summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2019-04-27 00:25:11 +0000
committerPetr Hosek <phosek@chromium.org>2019-04-27 00:25:11 +0000
commitb8a27facb342a656ec9e00a8e5ae58e0073e54d4 (patch)
tree40143e2465ae6ce6ec08522a1ff61f6b3aca8aa2 /include
parent6b3068a9c53b2160671833c21cf15cc1cd17b0e0 (diff)
[Driver] Support priority for multilibs
When more than one multilib flag matches, try to select the best possible match based on priority. When two different multilibs with the same same priority match, we still throw an error matching the existing behavior. Differential Revision: https://reviews.llvm.org/D60990 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/Driver/Multilib.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/clang/Driver/Multilib.h b/include/clang/Driver/Multilib.h
index 353aefde35..abf0d5fa6e 100644
--- a/include/clang/Driver/Multilib.h
+++ b/include/clang/Driver/Multilib.h
@@ -34,10 +34,11 @@ private:
std::string OSSuffix;
std::string IncludeSuffix;
flags_list Flags;
+ int Priority;
public:
Multilib(StringRef GCCSuffix = {}, StringRef OSSuffix = {},
- StringRef IncludeSuffix = {});
+ StringRef IncludeSuffix = {}, int Priority = 0);
/// Get the detected GCC installation path suffix for the multi-arch
/// target variant. Always starts with a '/', unless empty
@@ -77,6 +78,10 @@ public:
const flags_list &flags() const { return Flags; }
flags_list &flags() { return Flags; }
+ /// Returns the multilib priority. When more than one multilib matches flags,
+ /// the one with the highest priority is selected, with 0 being the default.
+ int priority() const { return Priority; }
+
/// Add a flag to the flags list
/// \p Flag must be a flag accepted by the driver with its leading '-' removed,
/// and replaced with either: