Skip to content

Commit 42c7ca1

Browse files
committed
Change in specification: DriverArgs now MacroDefines
We've decided to restrict the driver arguments that can be specified to only macro definitions. Hence this patch adjusts the YAML parsing for that.
1 parent 3914f0f commit 42c7ca1

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

clang/include/clang/Driver/Multilib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ using DeclarationPtr = std::shared_ptr<Declaration>;
107107

108108
struct ValueDetail {
109109
std::string Name;
110-
std::optional<SmallVector<std::string>> DriverArgs;
110+
std::optional<SmallVector<std::string>> MacroDefines;
111111
DeclarationPtr Decl;
112112
};
113113

clang/lib/Driver/Multilib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ struct llvm::yaml::MappingContextTraits<custom_flag::ValueDetail,
269269
static void mapping(llvm::yaml::IO &io, custom_flag::ValueDetail &V,
270270
llvm::SmallSet<std::string, 32> &) {
271271
io.mapRequired("Name", V.Name);
272-
io.mapOptional("DriverArgs", V.DriverArgs);
272+
io.mapOptional("MacroDefines", V.MacroDefines);
273273
}
274274
static std::string validate(IO &io, custom_flag::ValueDetail &V,
275275
llvm::SmallSet<std::string, 32> &NameSet) {

clang/test/Driver/baremetal-multilib-custom-flags-parsing.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# RUN: split-file %s %t
22

3-
# RUN: %clang --target=arm-none-eabi --multi-lib-config=%t/multilib-without-extra-build-args.yaml %s -### -o /dev/null 2>&1 \
3+
# RUN: %clang --target=arm-none-eabi --multi-lib-config=%t/multilib-without-macro-defines.yaml %s -### -o /dev/null 2>&1 \
44
# RUN: | FileCheck %s
5-
# RUN: %clang --target=arm-none-eabi --multi-lib-config=%t/multilib-with-extra-build-args.yaml %s -### -o /dev/null 2>&1 \
5+
# RUN: %clang --target=arm-none-eabi --multi-lib-config=%t/multilib-with-macro-defines.yaml %s -### -o /dev/null 2>&1 \
66
# RUN: | FileCheck %s
77
# CHECK-NOT: error:
88

@@ -27,7 +27,7 @@
2727
# CHECK-DUPLICATE-FLAG-VALUE-NAME: error: duplicate custom flag value name: "value-name"
2828
# CHECK-DUPLICATE-FLAG-VALUE-NAME-NEXT: - Name: value-name
2929

30-
#--- multilib-without-extra-build-args.yaml
30+
#--- multilib-without-macro-defines.yaml
3131
---
3232
MultilibVersion: 1.0
3333

@@ -42,7 +42,7 @@ Flags:
4242
- Name: b
4343
Default: a
4444

45-
#--- multilib-with-extra-build-args.yaml
45+
#--- multilib-with-macro-defines.yaml
4646
---
4747
MultilibVersion: 1.0
4848

@@ -54,9 +54,9 @@ Flags:
5454
- Name: flag
5555
Values:
5656
- Name: a
57-
DriverArgs: [-DFEATURE_A]
57+
MacroDefines: [FEATURE_A]
5858
- Name: b
59-
DriverArgs: [-DFEATURE_B]
59+
MacroDefines: [FEATURE_B]
6060
Default: a
6161

6262
#--- missing-flag-name.yaml

0 commit comments

Comments
 (0)