Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit c2e70b4

Browse files
committed
[arcmt] Remove '-arcmt-modify-in-memory', it turned out less useful than we hoped it would be.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133315 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 829f200 commit c2e70b4

File tree

10 files changed

+3
-86
lines changed

10 files changed

+3
-86
lines changed

include/clang/ARCMigrate/ARCMT.h

-6
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ bool applyTransformations(CompilerInvocation &origCI,
4141
llvm::StringRef Filename, InputKind Kind,
4242
DiagnosticClient *DiagClient);
4343

44-
/// \brief Like applyTransformations but no source file is modified, compilation
45-
/// happens using in-memory buffers.
46-
bool applyTransformationsInMemory(CompilerInvocation &origCI,
47-
llvm::StringRef Filename, InputKind Kind,
48-
DiagnosticClient *DiagClient);
49-
5044
typedef void (*TransformFn)(MigrationPass &pass);
5145

5246
std::vector<TransformFn> getAllTransformations();

include/clang/ARCMigrate/ARCMTActions.h

-8
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ class TransformationAction : public WrapperFrontendAction {
3232
TransformationAction(FrontendAction *WrappedAction);
3333
};
3434

35-
class InMemoryTransformationAction : public WrapperFrontendAction {
36-
protected:
37-
virtual void ExecuteAction();
38-
39-
public:
40-
InMemoryTransformationAction(FrontendAction *WrappedAction);
41-
};
42-
4335
}
4436
}
4537

include/clang/Driver/CC1Options.td

-2
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,6 @@ def arcmt_check : Flag<"-arcmt-check">,
387387
HelpText<"Check for ARC migration issues that need manual handling">;
388388
def arcmt_modify : Flag<"-arcmt-modify">,
389389
HelpText<"Apply modifications to files to conform to ARC">;
390-
def arcmt_modify_in_memory : Flag<"-arcmt-modify-in-memory">,
391-
HelpText<"Apply ARC conforming modifications & compile using memory buffers">;
392390

393391
def import_module : Separate<"-import-module">,
394392
HelpText<"Import a module definition file">;

include/clang/Driver/Options.td

-2
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ def ccc_arrmt_check : Flag<"-ccc-arrmt-check">, CCCDriverOpt,
116116
HelpText<"Check for ARC migration issues that need manual handling">;
117117
def ccc_arrmt_modify : Flag<"-ccc-arrmt-modify">, CCCDriverOpt,
118118
HelpText<"Apply modifications to files to conform to ARC">;
119-
def ccc_arrmt_modify_in_memory : Flag<"-ccc-arrmt-modify-in-memory">,
120-
HelpText<"Apply ARC conforming modifications & compile using memory buffers">;
121119

122120
// Make sure all other -ccc- options are rejected.
123121
def ccc_ : Joined<"-ccc-">, Group<ccc_Group>, Flags<[Unsupported]>;

include/clang/Frontend/FrontendOptions.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ class FrontendOptions {
8080
enum {
8181
ARCMT_None,
8282
ARCMT_Check,
83-
ARCMT_Modify,
84-
ARCMT_ModifyInMemory
83+
ARCMT_Modify
8584
} ARCMTAction;
8685

8786
/// The input files and their types.

lib/ARCMigrate/ARCMT.cpp

-35
Original file line numberDiff line numberDiff line change
@@ -276,41 +276,6 @@ bool arcmt::applyTransformations(CompilerInvocation &origCI,
276276
return migration.getRemapper().overwriteOriginal(*Diags);
277277
}
278278

279-
//===----------------------------------------------------------------------===//
280-
// applyTransformationsInMemory.
281-
//===----------------------------------------------------------------------===//
282-
283-
bool arcmt::applyTransformationsInMemory(CompilerInvocation &origCI,
284-
llvm::StringRef Filename, InputKind Kind,
285-
DiagnosticClient *DiagClient) {
286-
if (!origCI.getLangOpts().ObjC1)
287-
return false;
288-
289-
// Make sure checking is successful first.
290-
CompilerInvocation CInvokForCheck(origCI);
291-
if (arcmt::checkForManualIssues(CInvokForCheck, Filename, Kind, DiagClient))
292-
return true;
293-
294-
CompilerInvocation CInvok(origCI);
295-
CInvok.getFrontendOpts().Inputs.clear();
296-
CInvok.getFrontendOpts().Inputs.push_back(std::make_pair(Kind, Filename));
297-
298-
MigrationProcess migration(CInvok, DiagClient);
299-
300-
std::vector<TransformFn> transforms = arcmt::getAllTransformations();
301-
assert(!transforms.empty());
302-
303-
for (unsigned i=0, e = transforms.size(); i != e; ++i) {
304-
bool err = migration.applyTransform(transforms[i]);
305-
if (err) return true;
306-
}
307-
308-
origCI.getLangOpts().ObjCAutoRefCount = true;
309-
migration.getRemapper().transferMappingsAndClear(origCI);
310-
311-
return false;
312-
}
313-
314279
//===----------------------------------------------------------------------===//
315280
// CollectTransformActions.
316281
//===----------------------------------------------------------------------===//

lib/ARCMigrate/ARCMTActions.cpp

-15
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,3 @@ void TransformationAction::ExecuteAction() {
4141

4242
TransformationAction::TransformationAction(FrontendAction *WrappedAction)
4343
: WrapperFrontendAction(WrappedAction) {}
44-
45-
void InMemoryTransformationAction::ExecuteAction() {
46-
CompilerInstance &CI = getCompilerInstance();
47-
if (arcmt::applyTransformationsInMemory(CI.getInvocation(), getCurrentFile(),
48-
getCurrentFileKind(),
49-
CI.getDiagnostics().getClient()))
50-
return;
51-
52-
WrapperFrontendAction::ExecuteAction();
53-
}
54-
55-
InMemoryTransformationAction::InMemoryTransformationAction(
56-
FrontendAction *WrappedAction)
57-
: WrapperFrontendAction(WrappedAction) {}
58-

lib/Driver/Tools.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -1391,8 +1391,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
13911391

13921392
if (!Args.hasArg(options::OPT_fno_objc_arc)) {
13931393
if (const Arg *A = Args.getLastArg(options::OPT_ccc_arrmt_check,
1394-
options::OPT_ccc_arrmt_modify,
1395-
options::OPT_ccc_arrmt_modify_in_memory)) {
1394+
options::OPT_ccc_arrmt_modify)) {
13961395
switch (A->getOption().getID()) {
13971396
default:
13981397
llvm_unreachable("missed a case");
@@ -1402,9 +1401,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
14021401
case options::OPT_ccc_arrmt_modify:
14031402
CmdArgs.push_back("-arcmt-modify");
14041403
break;
1405-
case options::OPT_ccc_arrmt_modify_in_memory:
1406-
CmdArgs.push_back("-arcmt-modify-in-memory");
1407-
break;
14081404
}
14091405
}
14101406
}

lib/Frontend/CompilerInvocation.cpp

+1-8
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,6 @@ static void FrontendOptsToArgs(const FrontendOptions &Opts,
424424
case FrontendOptions::ARCMT_Modify:
425425
Res.push_back("-arcmt-modify");
426426
break;
427-
case FrontendOptions::ARCMT_ModifyInMemory:
428-
Res.push_back("-arcmt-modify-in-memory");
429-
break;
430427
}
431428

432429
bool NeedLang = false;
@@ -1242,8 +1239,7 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
12421239

12431240
Opts.ARCMTAction = FrontendOptions::ARCMT_None;
12441241
if (const Arg *A = Args.getLastArg(OPT_arcmt_check,
1245-
OPT_arcmt_modify,
1246-
OPT_arcmt_modify_in_memory)) {
1242+
OPT_arcmt_modify)) {
12471243
switch (A->getOption().getID()) {
12481244
default:
12491245
llvm_unreachable("missed a case");
@@ -1253,9 +1249,6 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
12531249
case OPT_arcmt_modify:
12541250
Opts.ARCMTAction = FrontendOptions::ARCMT_Modify;
12551251
break;
1256-
case OPT_arcmt_modify_in_memory:
1257-
Opts.ARCMTAction = FrontendOptions::ARCMT_ModifyInMemory;
1258-
break;
12591252
}
12601253
}
12611254

lib/FrontendTool/ExecuteCompilerInvocation.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ static FrontendAction *CreateFrontendAction(CompilerInstance &CI) {
100100
case FrontendOptions::ARCMT_Modify:
101101
Act = new arcmt::TransformationAction(Act);
102102
break;
103-
case FrontendOptions::ARCMT_ModifyInMemory:
104-
Act = new arcmt::InMemoryTransformationAction(Act);
105-
break;
106103
}
107104

108105
// If there are any AST files to merge, create a frontend action

0 commit comments

Comments
 (0)