[clang] 05eeda9 - [clang][cli] Turn arcmt-* options into a single option
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 18 01:54:04 PST 2020
Author: Jan Svoboda
Date: 2020-11-18T10:53:41+01:00
New Revision: 05eeda9752b393c074dd22716670bc3b9671270d
URL: https://github.com/llvm/llvm-project/commit/05eeda9752b393c074dd22716670bc3b9671270d
DIFF: https://github.com/llvm/llvm-project/commit/05eeda9752b393c074dd22716670bc3b9671270d.diff
LOG: [clang][cli] Turn arcmt-* options into a single option
- The new option, -arcmt-action, is a simple enum based option.
- The driver is modified to translate the existing -ccc-acmt-* options accordingly
Depends on D83298
Reviewed By: Bigcheese
Original patch by Daniel Grumberg.
Differential Revision: https://reviews.llvm.org/D83315
Added:
Modified:
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/ARCMT/GC-check-warn-nsalloc.m
clang/test/ARCMT/GC-check.m
clang/test/ARCMT/atautorelease-check.m
clang/test/ARCMT/check-api.m
clang/test/ARCMT/check-with-pch.m
clang/test/ARCMT/check-with-serialized-diag.m
clang/test/ARCMT/checking-in-arc.m
clang/test/ARCMT/checking.m
clang/test/ARCMT/cxx-checking.mm
clang/test/ARCMT/driver-migrate.m
clang/test/ARCMT/migrate-emit-errors.m
clang/test/ARCMT/migrate-plist-output.m
clang/test/ARCMT/migrate-space-in-path.m
clang/test/ARCMT/migrate-with-pch.m
clang/test/ARCMT/migrate.m
clang/test/ARCMT/no-canceling-bridge-to-bridge-cast.m
clang/test/ARCMT/nonobjc-to-objc-cast-2.m
clang/test/ARCMT/releases-driver.m
clang/test/ARCMT/releases-driver.m.result
clang/test/ARCMT/verify.m
clang/test/ARCMT/with-arc-mode-modify.m
clang/test/ARCMT/with-arc-mode-modify.m.result
llvm/include/llvm/Option/OptParser.td
llvm/utils/TableGen/OptParserEmitter.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index b850f6466a34..cd5cb37c93cd 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -3832,7 +3832,7 @@ def mrelocation_model : Separate<["-"], "mrelocation-model">,
HelpText<"The relocation model to use">, Values<"static,pic,ropi,rwpi,ropi-rwpi,dynamic-no-pic">,
NormalizedValuesScope<"llvm::Reloc">,
NormalizedValues<["Static", "PIC_", "ROPI", "RWPI", "ROPI_RWPI", "DynamicNoPIC"]>,
- MarshallingInfoString<"CodeGenOpts.RelocationModel", "PIC_", "Model">,
+ MarshallingInfoString<"CodeGenOpts.RelocationModel", "PIC_", "llvm::Reloc::Model">,
AutoNormalizeEnum;
def fno_math_builtin : Flag<["-"], "fno-math-builtin">,
HelpText<"Disable implicit builtin knowledge of math functions">;
@@ -4262,12 +4262,13 @@ def no_emit_llvm_uselists : Flag<["-"], "no-emit-llvm-uselists">,
def mt_migrate_directory : Separate<["-"], "mt-migrate-directory">,
HelpText<"Directory for temporary files produced during ARC or ObjC migration">;
-def arcmt_check : Flag<["-"], "arcmt-check">,
- HelpText<"Check for ARC migration issues that need manual handling">;
-def arcmt_modify : Flag<["-"], "arcmt-modify">,
- HelpText<"Apply modifications to files to conform to ARC">;
-def arcmt_migrate : Flag<["-"], "arcmt-migrate">,
- HelpText<"Apply modifications and produces temporary files that conform to ARC">;
+
+def arcmt_action_EQ : Joined<["-"], "arcmt-action=">, Flags<[CC1Option, NoDriverOption]>,
+ HelpText<"The ARC migration action to take">, Values<"check,modify,migrate">,
+ NormalizedValuesScope<"FrontendOptions">,
+ NormalizedValues<["ARCMT_Check", "ARCMT_Modify", "ARCMT_Migrate"]>,
+ MarshallingInfoString<"FrontendOpts.ARCMTAction", "ARCMT_None", "unsigned">,
+ AutoNormalizeEnumJoined;
def opt_record_file : Separate<["-"], "opt-record-file">,
HelpText<"File name to use for YAML optimization record output">;
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index ae9e1ce61d11..ad242d24e5c9 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3190,13 +3190,13 @@ static void RenderARCMigrateToolOptions(const Driver &D, const ArgList &Args,
switch (A->getOption().getID()) {
default: llvm_unreachable("missed a case");
case options::OPT_ccc_arcmt_check:
- CmdArgs.push_back("-arcmt-check");
+ CmdArgs.push_back("-arcmt-action=check");
break;
case options::OPT_ccc_arcmt_modify:
- CmdArgs.push_back("-arcmt-modify");
+ CmdArgs.push_back("-arcmt-action=modify");
break;
case options::OPT_ccc_arcmt_migrate:
- CmdArgs.push_back("-arcmt-migrate");
+ CmdArgs.push_back("-arcmt-action=migrate");
CmdArgs.push_back("-mt-migrate-directory");
CmdArgs.push_back(A->getValue());
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 2ea1027e125d..8916fe6a4756 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -171,6 +171,24 @@ static void denormalizeBooleanFlag(SmallVectorImpl<const char *> &Args,
Args.push_back(NegSpelling);
}
+static Optional<SimpleEnumValue>
+findValueTableByName(const SimpleEnumValueTable &Table, StringRef Name) {
+ for (int I = 0, E = Table.Size; I != E; ++I)
+ if (Name == Table.Table[I].Name)
+ return Table.Table[I];
+
+ return None;
+}
+
+static Optional<SimpleEnumValue>
+findValueTableByValue(const SimpleEnumValueTable &Table, unsigned Value) {
+ for (int I = 0, E = Table.Size; I != E; ++I)
+ if (Value == Table.Table[I].Value)
+ return Table.Table[I];
+
+ return None;
+}
+
static llvm::Optional<unsigned> normalizeSimpleEnum(OptSpecifier Opt,
unsigned TableIndex,
const ArgList &Args,
@@ -183,9 +201,8 @@ static llvm::Optional<unsigned> normalizeSimpleEnum(OptSpecifier Opt,
return None;
StringRef ArgValue = Arg->getValue();
- for (int I = 0, E = Table.Size; I != E; ++I)
- if (ArgValue == Table.Table[I].Name)
- return Table.Table[I].Value;
+ if (auto MaybeEnumVal = findValueTableByName(Table, ArgValue))
+ return MaybeEnumVal->Value;
Diags.Report(diag::err_drv_invalid_value)
<< Arg->getAsString(Args) << ArgValue;
@@ -198,16 +215,26 @@ static void denormalizeSimpleEnum(SmallVectorImpl<const char *> &Args,
unsigned TableIndex, unsigned Value) {
assert(TableIndex < SimpleEnumValueTablesSize);
const SimpleEnumValueTable &Table = SimpleEnumValueTables[TableIndex];
- for (int I = 0, E = Table.Size; I != E; ++I) {
- if (Value == Table.Table[I].Value) {
- Args.push_back(Spelling);
- Args.push_back(Table.Table[I].Name);
- return;
- }
+ if (auto MaybeEnumVal = findValueTableByValue(Table, Value)) {
+ Args.push_back(Spelling);
+ Args.push_back(MaybeEnumVal->Name);
+ } else {
+ llvm_unreachable("The simple enum value was not correctly defined in "
+ "the tablegen option description");
}
+}
- llvm_unreachable("The simple enum value was not correctly defined in "
- "the tablegen option description");
+static void denormalizeSimpleEnumJoined(SmallVectorImpl<const char *> &Args,
+ const char *Spelling,
+ CompilerInvocation::StringAllocator SA,
+ unsigned TableIndex, unsigned Value) {
+ assert(TableIndex < SimpleEnumValueTablesSize);
+ const SimpleEnumValueTable &Table = SimpleEnumValueTables[TableIndex];
+ if (auto MaybeEnumVal = findValueTableByValue(Table, Value))
+ Args.push_back(SA(Twine(Spelling) + MaybeEnumVal->Name));
+ else
+ llvm_unreachable("The simple enum value was not correctly defined in "
+ "the tablegen option description");
}
static void denormalizeString(SmallVectorImpl<const char *> &Args,
@@ -229,7 +256,7 @@ static Optional<std::string> normalizeTriple(OptSpecifier Opt, int TableIndex,
template <typename T, typename U>
static T mergeForwardValue(T KeyPath, U Value) {
- return Value;
+ return static_cast<T>(Value);
}
template <typename T, typename U> static T mergeMaskValue(T KeyPath, U Value) {
@@ -2058,23 +2085,6 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
Opts.AuxTargetFeatures = Args.getAllArgValues(OPT_aux_target_feature);
Opts.StatsFile = std::string(Args.getLastArgValue(OPT_stats_file));
- if (const Arg *A = Args.getLastArg(OPT_arcmt_check,
- OPT_arcmt_modify,
- OPT_arcmt_migrate)) {
- switch (A->getOption().getID()) {
- default:
- llvm_unreachable("missed a case");
- case OPT_arcmt_check:
- Opts.ARCMTAction = FrontendOptions::ARCMT_Check;
- break;
- case OPT_arcmt_modify:
- Opts.ARCMTAction = FrontendOptions::ARCMT_Modify;
- break;
- case OPT_arcmt_migrate:
- Opts.ARCMTAction = FrontendOptions::ARCMT_Migrate;
- break;
- }
- }
Opts.MTMigrateDir =
std::string(Args.getLastArgValue(OPT_mt_migrate_directory));
Opts.ARCMTMigrateReportOut =
diff --git a/clang/test/ARCMT/GC-check-warn-nsalloc.m b/clang/test/ARCMT/GC-check-warn-nsalloc.m
index 44ccc95e3f7c..af17c1d69c5f 100644
--- a/clang/test/ARCMT/GC-check-warn-nsalloc.m
+++ b/clang/test/ARCMT/GC-check-warn-nsalloc.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -arcmt-check -no-ns-alloc-error -triple x86_64-apple-darwin10 -fobjc-gc-only %s 2>&1 | grep 'warning: \[rewriter\] call returns pointer to GC managed memory'
-// RUN: %clang_cc1 -arcmt-check -no-ns-alloc-error -triple x86_64-apple-darwin10 -fobjc-gc-only -x objective-c++ %s 2>&1 | grep 'warning: \[rewriter\] call returns pointer to GC managed memory'
+// RUN: %clang_cc1 -arcmt-action=check -no-ns-alloc-error -triple x86_64-apple-darwin10 -fobjc-gc-only %s 2>&1 | grep 'warning: \[rewriter\] call returns pointer to GC managed memory'
+// RUN: %clang_cc1 -arcmt-action=check -no-ns-alloc-error -triple x86_64-apple-darwin10 -fobjc-gc-only -x objective-c++ %s 2>&1 | grep 'warning: \[rewriter\] call returns pointer to GC managed memory'
// TODO: Investigate VerifyDiagnosticConsumer failures on these tests when using -verify.
// rdar://10532541
diff --git a/clang/test/ARCMT/GC-check.m b/clang/test/ARCMT/GC-check.m
index 9864354228be..e95e285432e0 100644
--- a/clang/test/ARCMT/GC-check.m
+++ b/clang/test/ARCMT/GC-check.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fobjc-gc-only %s
-// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fobjc-gc-only -x objective-c++ %s
+// RUN: %clang_cc1 -arcmt-action=check -verify -triple x86_64-apple-darwin10 -fobjc-gc-only %s
+// RUN: %clang_cc1 -arcmt-action=check -verify -triple x86_64-apple-darwin10 -fobjc-gc-only -x objective-c++ %s
#define CF_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
typedef unsigned NSUInteger;
diff --git a/clang/test/ARCMT/atautorelease-check.m b/clang/test/ARCMT/atautorelease-check.m
index d74ef3b61d1f..5f8ffa8bc40e 100644
--- a/clang/test/ARCMT/atautorelease-check.m
+++ b/clang/test/ARCMT/atautorelease-check.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 %s
+// RUN: %clang_cc1 -arcmt-action=check -verify -triple x86_64-apple-darwin10 %s
#if __has_feature(objc_arr)
#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
diff --git a/clang/test/ARCMT/check-api.m b/clang/test/ARCMT/check-api.m
index 11f431377da6..b395f0b4a4b9 100644
--- a/clang/test/ARCMT/check-api.m
+++ b/clang/test/ARCMT/check-api.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-macosx10.7 %s
+// RUN: %clang_cc1 -arcmt-action=check -verify -triple x86_64-apple-macosx10.7 %s
#include "Common.h"
diff --git a/clang/test/ARCMT/check-with-pch.m b/clang/test/ARCMT/check-with-pch.m
index 5e843ff08df7..c20646b68f24 100644
--- a/clang/test/ARCMT/check-with-pch.m
+++ b/clang/test/ARCMT/check-with-pch.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -x objective-c -triple x86_64-apple-darwin10 %S/Common.h -emit-pch -o %t.pch
-// RUN: %clang_cc1 -include-pch %t.pch -arcmt-check -verify -triple x86_64-apple-darwin10 -fblocks -Werror %s
+// RUN: %clang_cc1 -include-pch %t.pch -arcmt-action=check -verify -triple x86_64-apple-darwin10 -fblocks -Werror %s
// REQUIRES: x86-registered-target
// rdar://9601437
diff --git a/clang/test/ARCMT/check-with-serialized-diag.m b/clang/test/ARCMT/check-with-serialized-diag.m
index 77bad96dcc3a..6102be037fcc 100644
--- a/clang/test/ARCMT/check-with-serialized-diag.m
+++ b/clang/test/ARCMT/check-with-serialized-diag.m
@@ -35,7 +35,7 @@ void test1(A *a, struct UnsafeS *unsafeS) {
[a retainCount];
}
-// RUN: not %clang_cc1 -arcmt-check -triple x86_64-apple-darwin10 %s -serialize-diagnostic-file %t.diag
+// RUN: not %clang_cc1 -arcmt-action=check -triple x86_64-apple-darwin10 %s -serialize-diagnostic-file %t.diag
// RUN: c-index-test -read-diagnostics %t.diag > %t 2>&1
// RUN: FileCheck --input-file=%t %s
diff --git a/clang/test/ARCMT/checking-in-arc.m b/clang/test/ARCMT/checking-in-arc.m
index d41a162289b2..1bf6aca18a34 100644
--- a/clang/test/ARCMT/checking-in-arc.m
+++ b/clang/test/ARCMT/checking-in-arc.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -arcmt-check -fobjc-arc -fobjc-runtime=macosx-10.8.0 -triple x86_64-apple-darwin12 -fblocks -Werror %s
+// RUN: %clang_cc1 -arcmt-action=check -fobjc-arc -fobjc-runtime=macosx-10.8.0 -triple x86_64-apple-darwin12 -fblocks -Werror %s
#if __has_feature(objc_arc)
#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
diff --git a/clang/test/ARCMT/checking.m b/clang/test/ARCMT/checking.m
index 182260c18e59..bf08ceaa6fe2 100644
--- a/clang/test/ARCMT/checking.m
+++ b/clang/test/ARCMT/checking.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fblocks -Werror %s
+// RUN: %clang_cc1 -arcmt-action=check -verify -triple x86_64-apple-darwin10 -fblocks -Werror %s
#if __has_feature(objc_arc)
#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
diff --git a/clang/test/ARCMT/cxx-checking.mm b/clang/test/ARCMT/cxx-checking.mm
index aa3bc466f672..952f3cdcbb79 100644
--- a/clang/test/ARCMT/cxx-checking.mm
+++ b/clang/test/ARCMT/cxx-checking.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fsyntax-only -fblocks %s
+// RUN: %clang_cc1 -arcmt-action=check -verify -triple x86_64-apple-darwin10 -fsyntax-only -fblocks %s
// Classes that have an Objective-C object pointer.
struct HasObjectMember0 {
diff --git a/clang/test/ARCMT/driver-migrate.m b/clang/test/ARCMT/driver-migrate.m
index b1e419ae6fb3..ec3f4cc8c4a3 100644
--- a/clang/test/ARCMT/driver-migrate.m
+++ b/clang/test/ARCMT/driver-migrate.m
@@ -1,6 +1,6 @@
// RUN: %clang -### -ccc-arcmt-migrate /foo/bar -fsyntax-only %s 2>&1 | FileCheck %s
-// CHECK: "-arcmt-migrate" "-mt-migrate-directory" "{{[^"]*}}/foo/bar"
+// CHECK: "-arcmt-action=migrate" "-mt-migrate-directory" "{{[^"]*}}/foo/bar"
// RUN: touch %t.o
// RUN: %clang -ccc-arcmt-check -target i386-apple-darwin9 -### %t.o 2> %t.log
diff --git a/clang/test/ARCMT/migrate-emit-errors.m b/clang/test/ARCMT/migrate-emit-errors.m
index 95c0d2f8f073..3e33acf75a59 100644
--- a/clang/test/ARCMT/migrate-emit-errors.m
+++ b/clang/test/ARCMT/migrate-emit-errors.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t -arcmt-migrate-emit-errors %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -arcmt-action=migrate -mt-migrate-directory %t -arcmt-migrate-emit-errors %s 2>&1 | FileCheck %s
// RUN: rm -rf %t
@protocol NSObject
@@ -9,4 +9,4 @@ void test(id p) {
[p release];
}
-// CHECK: error: ARC forbids explicit message send of 'release'
\ No newline at end of file
+// CHECK: error: ARC forbids explicit message send of 'release'
diff --git a/clang/test/ARCMT/migrate-plist-output.m b/clang/test/ARCMT/migrate-plist-output.m
index 9b47b91d5809..e5710d818ecc 100644
--- a/clang/test/ARCMT/migrate-plist-output.m
+++ b/clang/test/ARCMT/migrate-plist-output.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t.dir -arcmt-migrate-report-output %t.plist %s
+// RUN: %clang_cc1 -arcmt-action=migrate -mt-migrate-directory %t.dir -arcmt-migrate-report-output %t.plist %s
// RUN: FileCheck %s -input-file=%t.plist
// RUN: rm -rf %t.dir
diff --git a/clang/test/ARCMT/migrate-space-in-path.m b/clang/test/ARCMT/migrate-space-in-path.m
index d060485ee20e..14a464d438f4 100644
--- a/clang/test/ARCMT/migrate-space-in-path.m
+++ b/clang/test/ARCMT/migrate-space-in-path.m
@@ -1,5 +1,5 @@
// RUN: rm -rf %t.migrate
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t.migrate %S/Inputs/"with space"/test1.m.in -x objective-c
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t.migrate %S/Inputs/"with space"/test2.m.in -x objective-c
+// RUN: %clang_cc1 -arcmt-action=migrate -mt-migrate-directory %t.migrate %S/Inputs/"with space"/test1.m.in -x objective-c
+// RUN: %clang_cc1 -arcmt-action=migrate -mt-migrate-directory %t.migrate %S/Inputs/"with space"/test2.m.in -x objective-c
// RUN: c-arcmt-test -mt-migrate-directory %t.migrate | arcmt-test -verify-transformed-files %S/Inputs/"with space"/test1.m.in.result %S/Inputs/"with space"/test2.m.in.result %S/Inputs/"with space"/test.h.result
// RUN: rm -rf %t.migrate
diff --git a/clang/test/ARCMT/migrate-with-pch.m b/clang/test/ARCMT/migrate-with-pch.m
index 1aafbdaf9b1e..d8e261be13d8 100644
--- a/clang/test/ARCMT/migrate-with-pch.m
+++ b/clang/test/ARCMT/migrate-with-pch.m
@@ -1,6 +1,6 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -x objective-c %S/Common.h -emit-pch -o %t.pch
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t %S/Inputs/test1.m.in -x objective-c -include-pch %t.pch
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t %S/Inputs/test2.m.in -x objective-c -include-pch %t.pch
+// RUN: %clang_cc1 -arcmt-action=migrate -mt-migrate-directory %t %S/Inputs/test1.m.in -x objective-c -include-pch %t.pch
+// RUN: %clang_cc1 -arcmt-action=migrate -mt-migrate-directory %t %S/Inputs/test2.m.in -x objective-c -include-pch %t.pch
// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %S/Inputs/test1.m.in.result %S/Inputs/test2.m.in.result %S/Inputs/test.h.result
// RUN: rm -rf %t
diff --git a/clang/test/ARCMT/migrate.m b/clang/test/ARCMT/migrate.m
index d92cef7eb7cc..bc819df1c8a1 100644
--- a/clang/test/ARCMT/migrate.m
+++ b/clang/test/ARCMT/migrate.m
@@ -1,5 +1,5 @@
// RUN: rm -rf %t
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t %S/Inputs/test1.m.in -x objective-c
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t %S/Inputs/test2.m.in -x objective-c
+// RUN: %clang_cc1 -arcmt-action=migrate -mt-migrate-directory %t %S/Inputs/test1.m.in -x objective-c
+// RUN: %clang_cc1 -arcmt-action=migrate -mt-migrate-directory %t %S/Inputs/test2.m.in -x objective-c
// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %S/Inputs/test1.m.in.result %S/Inputs/test2.m.in.result %S/Inputs/test.h.result
// RUN: rm -rf %t
diff --git a/clang/test/ARCMT/no-canceling-bridge-to-bridge-cast.m b/clang/test/ARCMT/no-canceling-bridge-to-bridge-cast.m
index 2c47822001e5..3e440d660c19 100644
--- a/clang/test/ARCMT/no-canceling-bridge-to-bridge-cast.m
+++ b/clang/test/ARCMT/no-canceling-bridge-to-bridge-cast.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -arcmt-check -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -verify %s
+// RUN: %clang_cc1 -arcmt-action=check -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -verify %s
// rdar://10387088
typedef const void * CFTypeRef;
CFTypeRef CFBridgingRetain(id X);
diff --git a/clang/test/ARCMT/nonobjc-to-objc-cast-2.m b/clang/test/ARCMT/nonobjc-to-objc-cast-2.m
index 2b421b0757ad..2e308a87ba83 100644
--- a/clang/test/ARCMT/nonobjc-to-objc-cast-2.m
+++ b/clang/test/ARCMT/nonobjc-to-objc-cast-2.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 %s
+// RUN: %clang_cc1 -arcmt-action=check -verify -triple x86_64-apple-darwin10 %s
#include "Common.h"
diff --git a/clang/test/ARCMT/releases-driver.m b/clang/test/ARCMT/releases-driver.m
index 3dd546fd6cd5..f2f5b0848e8b 100644
--- a/clang/test/ARCMT/releases-driver.m
+++ b/clang/test/ARCMT/releases-driver.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fblocks -fsyntax-only -fobjc-arc -x objective-c %s.result
// RUN: cat %s > %t
-// RUN: %clang_cc1 -arcmt-modify -triple x86_64-apple-macosx10.6 -x objective-c %t
+// RUN: %clang_cc1 -arcmt-action=modify -triple x86_64-apple-macosx10.6 -x objective-c %t
// RUN:
diff %t %s.result
// RUN: rm %t
diff --git a/clang/test/ARCMT/releases-driver.m.result b/clang/test/ARCMT/releases-driver.m.result
index e9aa2d5ac44e..e4427e6796e0 100644
--- a/clang/test/ARCMT/releases-driver.m.result
+++ b/clang/test/ARCMT/releases-driver.m.result
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fblocks -fsyntax-only -fobjc-arc -x objective-c %s.result
// RUN: cat %s > %t
-// RUN: %clang_cc1 -arcmt-modify -triple x86_64-apple-macosx10.6 -x objective-c %t
+// RUN: %clang_cc1 -arcmt-action=modify -triple x86_64-apple-macosx10.6 -x objective-c %t
// RUN:
diff %t %s.result
// RUN: rm %t
diff --git a/clang/test/ARCMT/verify.m b/clang/test/ARCMT/verify.m
index 02f7fccc6899..9b46c1a729ac 100644
--- a/clang/test/ARCMT/verify.m
+++ b/clang/test/ARCMT/verify.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -arcmt-check -verify %s
-// RUN: not %clang_cc1 -arcmt-check -verify %t.invalid 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -arcmt-action=check -verify %s
+// RUN: not %clang_cc1 -arcmt-action=check -verify %t.invalid 2>&1 | FileCheck %s
#if 0
// expected-error {{should be ignored}}
diff --git a/clang/test/ARCMT/with-arc-mode-modify.m b/clang/test/ARCMT/with-arc-mode-modify.m
index bc4662de23e8..beff6784bbbb 100644
--- a/clang/test/ARCMT/with-arc-mode-modify.m
+++ b/clang/test/ARCMT/with-arc-mode-modify.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -x objective-c %s.result
// RUN: cat %s > %t
-// RUN: %clang_cc1 -arcmt-modify -fsyntax-only -fobjc-arc -x objective-c %t
+// RUN: %clang_cc1 -arcmt-action=modify -fsyntax-only -fobjc-arc -x objective-c %t
// RUN:
diff %t %s.result
// RUN: rm %t
diff --git a/clang/test/ARCMT/with-arc-mode-modify.m.result b/clang/test/ARCMT/with-arc-mode-modify.m.result
index b847c13f6b4c..685226db8654 100644
--- a/clang/test/ARCMT/with-arc-mode-modify.m.result
+++ b/clang/test/ARCMT/with-arc-mode-modify.m.result
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -x objective-c %s.result
// RUN: cat %s > %t
-// RUN: %clang_cc1 -arcmt-modify -fsyntax-only -fobjc-arc -x objective-c %t
+// RUN: %clang_cc1 -arcmt-action=modify -fsyntax-only -fobjc-arc -x objective-c %t
// RUN:
diff %t %s.result
// RUN: rm %t
diff --git a/llvm/include/llvm/Option/OptParser.td b/llvm/include/llvm/Option/OptParser.td
index 85874478e59e..12d2286ed89d 100644
--- a/llvm/include/llvm/Option/OptParser.td
+++ b/llvm/include/llvm/Option/OptParser.td
@@ -199,6 +199,9 @@ class AutoNormalizeEnum {
code Normalizer = "normalizeSimpleEnum";
code Denormalizer = "denormalizeSimpleEnum";
}
+class AutoNormalizeEnumJoined : AutoNormalizeEnum {
+ code Denormalizer = "denormalizeSimpleEnumJoined";
+}
class ValueMerger<code merger> { code ValueMerger = merger; }
class ValueExtractor<code extractor> { code ValueExtractor = extractor; }
diff --git a/llvm/utils/TableGen/OptParserEmitter.cpp b/llvm/utils/TableGen/OptParserEmitter.cpp
index 88f5dd3658c9..4e164fe28353 100644
--- a/llvm/utils/TableGen/OptParserEmitter.cpp
+++ b/llvm/utils/TableGen/OptParserEmitter.cpp
@@ -114,7 +114,7 @@ struct SimpleEnumValueTable {
OS << ", ";
emitScopedNormalizedValue(OS, DefaultValue);
OS << ", ";
- emitScopedNormalizedValue(OS, NormalizerRetTy);
+ OS << NormalizerRetTy;
OS << ", ";
OS << Normalizer;
OS << ", ";
More information about the cfe-commits
mailing list