-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Clang] Remove ARCMigrate #119269
[Clang] Remove ARCMigrate #119269
Conversation
@llvm/pr-subscribers-clang-static-analyzer-1 @llvm/pr-subscribers-clang Author: None (Sirraide) ChangesIn the discussion around #116792, @rjmccall mentioned that ARCMigrate has been obsoleted and that we could go ahead and remove it from Clang, so this patch does just that. I searched for every mention of ‘ARCMT’/‘ARCMigrate’/‘ObjCRewrite’ and removed everything that seemed related to what I was able to find. I also had to touch a bunch of bazel and gn build scripts as part of this, neither of which I’m familiar with so it’s possible that I missed something there. Patch is 1.49 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/119269.diff 383 Files Affected:
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 27e8095534a65c..7050746e3a0380 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -432,20 +432,11 @@ if(NOT LLVM_STATIC_LINK_CXX_STDLIB)
set(HAVE_CLANG_REPL_SUPPORT ON)
endif()
-option(CLANG_ENABLE_ARCMT "Build ARCMT." ON)
option(CLANG_ENABLE_STATIC_ANALYZER
"Include static analyzer in clang binary." ON)
option(CLANG_ENABLE_PROTO_FUZZER "Build Clang protobuf fuzzer." OFF)
-if(NOT CLANG_ENABLE_STATIC_ANALYZER AND CLANG_ENABLE_ARCMT)
- message(FATAL_ERROR "Cannot disable static analyzer while enabling ARCMT or Z3")
-endif()
-
-if(CLANG_ENABLE_ARCMT)
- set(CLANG_ENABLE_OBJC_REWRITER ON)
-endif()
-
# This option is a stop-gap, we should commit to removing this as
# soon as possible. See discussion:
# https://discourse.llvm.org/t/rationale-for-removing-versioned-libclang-middle-ground-to-keep-it-behind-option/
diff --git a/clang/cmake/caches/Android.cmake b/clang/cmake/caches/Android.cmake
index d5ca6b50d4ada7..c89e31f67cc9b1 100644
--- a/clang/cmake/caches/Android.cmake
+++ b/clang/cmake/caches/Android.cmake
@@ -2,7 +2,6 @@
set(LLVM_TARGETS_TO_BUILD X86 CACHE STRING "")
-set(CLANG_ENABLE_ARCMT OFF CACHE BOOL "")
set(CLANG_ENABLE_STATIC_ANALYZER OFF CACHE BOOL "")
set(CLANG_TIDY_ENABLE_STATIC_ANALYZER OFF CACHE BOOL "")
set(CLANG_VENDOR Android CACHE STRING "")
diff --git a/clang/cmake/caches/Fuchsia-stage2.cmake b/clang/cmake/caches/Fuchsia-stage2.cmake
index 784a883a3bf916..3db19c36acc581 100644
--- a/clang/cmake/caches/Fuchsia-stage2.cmake
+++ b/clang/cmake/caches/Fuchsia-stage2.cmake
@@ -44,7 +44,6 @@ set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "")
set(CLANG_DEFAULT_UNWINDLIB libunwind CACHE STRING "")
-set(CLANG_ENABLE_ARCMT OFF CACHE BOOL "")
set(CLANG_ENABLE_STATIC_ANALYZER ON CACHE BOOL "")
set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
diff --git a/clang/cmake/caches/Fuchsia.cmake b/clang/cmake/caches/Fuchsia.cmake
index 07637cd0ed08f0..83336589da305d 100644
--- a/clang/cmake/caches/Fuchsia.cmake
+++ b/clang/cmake/caches/Fuchsia.cmake
@@ -84,7 +84,6 @@ set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "")
set(CLANG_DEFAULT_UNWINDLIB libunwind CACHE STRING "")
-set(CLANG_ENABLE_ARCMT OFF CACHE BOOL "")
set(CLANG_ENABLE_STATIC_ANALYZER OFF CACHE BOOL "")
set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 3f58e64cf0ccbc..c168606af609ed 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -58,6 +58,8 @@ code bases.
containing strict-aliasing violations. The new default behavior can be
disabled using ``-fno-pointer-tbaa``.
+- The Objective-C ARC migrator (ARCMigrate) has been removed.
+
C/C++ Language Potentially Breaking Changes
-------------------------------------------
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index 8fc06328f0bcef..ee9e159b6dad76 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -5850,66 +5850,6 @@ CINDEX_LINKAGE const char *clang_EvalResult_getAsStr(CXEvalResult E);
* Disposes the created Eval memory.
*/
CINDEX_LINKAGE void clang_EvalResult_dispose(CXEvalResult E);
-/**
- * @}
- */
-
-/** \defgroup CINDEX_REMAPPING Remapping functions
- *
- * @{
- */
-
-/**
- * A remapping of original source files and their translated files.
- */
-typedef void *CXRemapping;
-
-/**
- * Retrieve a remapping.
- *
- * \param path the path that contains metadata about remappings.
- *
- * \returns the requested remapping. This remapping must be freed
- * via a call to \c clang_remap_dispose(). Can return NULL if an error occurred.
- */
-CINDEX_LINKAGE CXRemapping clang_getRemappings(const char *path);
-
-/**
- * Retrieve a remapping.
- *
- * \param filePaths pointer to an array of file paths containing remapping info.
- *
- * \param numFiles number of file paths.
- *
- * \returns the requested remapping. This remapping must be freed
- * via a call to \c clang_remap_dispose(). Can return NULL if an error occurred.
- */
-CINDEX_LINKAGE
-CXRemapping clang_getRemappingsFromFileList(const char **filePaths,
- unsigned numFiles);
-
-/**
- * Determine the number of remappings.
- */
-CINDEX_LINKAGE unsigned clang_remap_getNumFiles(CXRemapping);
-
-/**
- * Get the original and the associated filename from the remapping.
- *
- * \param original If non-NULL, will be set to the original filename.
- *
- * \param transformed If non-NULL, will be set to the filename that the original
- * is associated with.
- */
-CINDEX_LINKAGE void clang_remap_getFilenames(CXRemapping, unsigned index,
- CXString *original,
- CXString *transformed);
-
-/**
- * Dispose the remapping.
- */
-CINDEX_LINKAGE void clang_remap_dispose(CXRemapping);
-
/**
* @}
*/
diff --git a/clang/include/clang/ARCMigrate/ARCMT.h b/clang/include/clang/ARCMigrate/ARCMT.h
deleted file mode 100644
index 2b950e3d2cc2bf..00000000000000
--- a/clang/include/clang/ARCMigrate/ARCMT.h
+++ /dev/null
@@ -1,130 +0,0 @@
-//===-- ARCMT.h - ARC Migration Rewriter ------------------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_ARCMIGRATE_ARCMT_H
-#define LLVM_CLANG_ARCMIGRATE_ARCMT_H
-
-#include "clang/ARCMigrate/FileRemapper.h"
-#include "clang/Basic/SourceLocation.h"
-#include "clang/Frontend/CompilerInvocation.h"
-
-namespace clang {
- class ASTContext;
- class DiagnosticConsumer;
- class PCHContainerOperations;
-
-namespace arcmt {
- class MigrationPass;
-
-/// Creates an AST with the provided CompilerInvocation but with these
-/// changes:
-/// -if a PCH/PTH is set, the original header is used instead
-/// -Automatic Reference Counting mode is enabled
-///
-/// It then checks the AST and produces errors/warning for ARC migration issues
-/// that the user needs to handle manually.
-///
-/// \param emitPremigrationARCErrors if true all ARC errors will get emitted
-/// even if the migrator can fix them, but the function will still return false
-/// if all ARC errors can be fixed.
-///
-/// \param plistOut if non-empty, it is the file path to store the plist with
-/// the pre-migration ARC diagnostics.
-///
-/// \returns false if no error is produced, true otherwise.
-bool
-checkForManualIssues(CompilerInvocation &CI, const FrontendInputFile &Input,
- std::shared_ptr<PCHContainerOperations> PCHContainerOps,
- DiagnosticConsumer *DiagClient,
- bool emitPremigrationARCErrors = false,
- StringRef plistOut = StringRef());
-
-/// Works similar to checkForManualIssues but instead of checking, it
-/// applies automatic modifications to source files to conform to ARC.
-///
-/// \returns false if no error is produced, true otherwise.
-bool
-applyTransformations(CompilerInvocation &origCI,
- const FrontendInputFile &Input,
- std::shared_ptr<PCHContainerOperations> PCHContainerOps,
- DiagnosticConsumer *DiagClient);
-
-/// Applies automatic modifications and produces temporary files
-/// and metadata into the \p outputDir path.
-///
-/// \param emitPremigrationARCErrors if true all ARC errors will get emitted
-/// even if the migrator can fix them, but the function will still return false
-/// if all ARC errors can be fixed.
-///
-/// \param plistOut if non-empty, it is the file path to store the plist with
-/// the pre-migration ARC diagnostics.
-///
-/// \returns false if no error is produced, true otherwise.
-bool migrateWithTemporaryFiles(
- CompilerInvocation &origCI, const FrontendInputFile &Input,
- std::shared_ptr<PCHContainerOperations> PCHContainerOps,
- DiagnosticConsumer *DiagClient, StringRef outputDir,
- bool emitPremigrationARCErrors, StringRef plistOut);
-
-/// Get the set of file remappings from the \p outputDir path that
-/// migrateWithTemporaryFiles produced.
-///
-/// \returns false if no error is produced, true otherwise.
-bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
- StringRef outputDir,
- DiagnosticConsumer *DiagClient);
-
-/// Get the set of file remappings from a list of files with remapping
-/// info.
-///
-/// \returns false if no error is produced, true otherwise.
-bool getFileRemappingsFromFileList(
- std::vector<std::pair<std::string,std::string> > &remap,
- ArrayRef<StringRef> remapFiles,
- DiagnosticConsumer *DiagClient);
-
-typedef void (*TransformFn)(MigrationPass &pass);
-
-std::vector<TransformFn> getAllTransformations(LangOptions::GCMode OrigGCMode,
- bool NoFinalizeRemoval);
-
-class MigrationProcess {
- CompilerInvocation OrigCI;
- std::shared_ptr<PCHContainerOperations> PCHContainerOps;
- DiagnosticConsumer *DiagClient;
- FileRemapper Remapper;
-
-public:
- bool HadARCErrors;
-
- MigrationProcess(CompilerInvocation &CI,
- std::shared_ptr<PCHContainerOperations> PCHContainerOps,
- DiagnosticConsumer *diagClient,
- StringRef outputDir = StringRef());
-
- class RewriteListener {
- public:
- virtual ~RewriteListener();
-
- virtual void start(ASTContext &Ctx) { }
- virtual void finish() { }
-
- virtual void insert(SourceLocation loc, StringRef text) { }
- virtual void remove(CharSourceRange range) { }
- };
-
- bool applyTransform(TransformFn trans, RewriteListener *listener = nullptr);
-
- FileRemapper &getRemapper() { return Remapper; }
-};
-
-} // end namespace arcmt
-
-} // end namespace clang
-
-#endif
diff --git a/clang/include/clang/ARCMigrate/ARCMTActions.h b/clang/include/clang/ARCMigrate/ARCMTActions.h
deleted file mode 100644
index 714f4b33db446b..00000000000000
--- a/clang/include/clang/ARCMigrate/ARCMTActions.h
+++ /dev/null
@@ -1,76 +0,0 @@
-//===--- ARCMTActions.h - ARC Migrate Tool Frontend Actions -----*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_ARCMIGRATE_ARCMTACTIONS_H
-#define LLVM_CLANG_ARCMIGRATE_ARCMTACTIONS_H
-
-#include "clang/ARCMigrate/FileRemapper.h"
-#include "clang/Frontend/FrontendAction.h"
-#include <memory>
-
-namespace clang {
-namespace arcmt {
-
-class CheckAction : public WrapperFrontendAction {
-protected:
- bool BeginInvocation(CompilerInstance &CI) override;
-
-public:
- CheckAction(std::unique_ptr<FrontendAction> WrappedAction);
-};
-
-class ModifyAction : public WrapperFrontendAction {
-protected:
- bool BeginInvocation(CompilerInstance &CI) override;
-
-public:
- ModifyAction(std::unique_ptr<FrontendAction> WrappedAction);
-};
-
-class MigrateSourceAction : public ASTFrontendAction {
- FileRemapper Remapper;
-protected:
- bool BeginInvocation(CompilerInstance &CI) override;
- std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
- StringRef InFile) override;
-};
-
-class MigrateAction : public WrapperFrontendAction {
- std::string MigrateDir;
- std::string PlistOut;
- bool EmitPremigrationARCErrors;
-protected:
- bool BeginInvocation(CompilerInstance &CI) override;
-
-public:
- MigrateAction(std::unique_ptr<FrontendAction> WrappedAction,
- StringRef migrateDir,
- StringRef plistOut,
- bool emitPremigrationARCErrors);
-};
-
-/// Migrates to modern ObjC syntax.
-class ObjCMigrateAction : public WrapperFrontendAction {
- std::string MigrateDir;
- unsigned ObjCMigAction;
- FileRemapper Remapper;
- CompilerInstance *CompInst;
-public:
- ObjCMigrateAction(std::unique_ptr<FrontendAction> WrappedAction,
- StringRef migrateDir, unsigned migrateAction);
-
-protected:
- std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
- StringRef InFile) override;
- bool BeginInvocation(CompilerInstance &CI) override;
-};
-
-}
-}
-
-#endif
diff --git a/clang/include/clang/ARCMigrate/FileRemapper.h b/clang/include/clang/ARCMigrate/FileRemapper.h
deleted file mode 100644
index afcee363516a21..00000000000000
--- a/clang/include/clang/ARCMigrate/FileRemapper.h
+++ /dev/null
@@ -1,84 +0,0 @@
-//===-- FileRemapper.h - File Remapping Helper ------------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_ARCMIGRATE_FILEREMAPPER_H
-#define LLVM_CLANG_ARCMIGRATE_FILEREMAPPER_H
-
-#include "clang/Basic/FileEntry.h"
-#include "clang/Basic/LLVM.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/StringRef.h"
-#include <memory>
-#include <variant>
-
-namespace llvm {
- class MemoryBuffer;
- class MemoryBufferRef;
-}
-
-namespace clang {
- class FileManager;
- class DiagnosticsEngine;
- class PreprocessorOptions;
-
-namespace arcmt {
-
-class FileRemapper {
- // FIXME: Reuse the same FileManager for multiple ASTContexts.
- std::unique_ptr<FileManager> FileMgr;
-
- using Target = std::variant<FileEntryRef, llvm::MemoryBuffer *>;
- using MappingsTy = llvm::DenseMap<FileEntryRef, Target>;
- MappingsTy FromToMappings;
-
- llvm::DenseMap<const FileEntry *, FileEntryRef> ToFromMappings;
-
-public:
- FileRemapper();
- ~FileRemapper();
-
- bool initFromDisk(StringRef outputDir, DiagnosticsEngine &Diag,
- bool ignoreIfFilesChanged);
- bool initFromFile(StringRef filePath, DiagnosticsEngine &Diag,
- bool ignoreIfFilesChanged);
- bool flushToDisk(StringRef outputDir, DiagnosticsEngine &Diag);
- bool flushToFile(StringRef outputPath, DiagnosticsEngine &Diag);
-
- bool overwriteOriginal(DiagnosticsEngine &Diag,
- StringRef outputDir = StringRef());
-
- void remap(StringRef filePath, std::unique_ptr<llvm::MemoryBuffer> memBuf);
-
- void applyMappings(PreprocessorOptions &PPOpts) const;
-
- /// Iterate through all the mappings.
- void forEachMapping(
- llvm::function_ref<void(StringRef, StringRef)> CaptureFile,
- llvm::function_ref<void(StringRef, const llvm::MemoryBufferRef &)>
- CaptureBuffer) const;
-
- void clear(StringRef outputDir = StringRef());
-
-private:
- void remap(FileEntryRef file, std::unique_ptr<llvm::MemoryBuffer> memBuf);
- void remap(FileEntryRef file, FileEntryRef newfile);
-
- OptionalFileEntryRef getOriginalFile(StringRef filePath);
- void resetTarget(Target &targ);
-
- bool report(const Twine &err, DiagnosticsEngine &Diag);
-
- std::string getRemapInfoFile(StringRef outputDir);
-};
-
-} // end namespace arcmt
-
-} // end namespace clang
-
-#endif
diff --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td b/clang/include/clang/Basic/DiagnosticCommonKinds.td
index f4a155bb00bb37..f26c906b46447a 100644
--- a/clang/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td
@@ -402,16 +402,6 @@ def note_file_misc_sloc_usage : Note<
def err_module_format_unhandled : Error<
"no handler registered for module format '%0'">, DefaultFatal;
-// TransformActions
-// TODO: Use a custom category name to distinguish rewriter errors.
-def err_mt_message : Error<"[rewriter] %0">, SuppressInSystemHeader;
-def warn_mt_message : Warning<"[rewriter] %0">;
-def note_mt_message : Note<"[rewriter] %0">;
-
-// ARCMigrate
-def warn_arcmt_nsalloc_realloc : Warning<"[rewriter] call returns pointer to GC managed memory; it will become unmanaged in ARC">;
-def err_arcmt_nsinvocation_ownership : Error<"NSInvocation's %0 is not safe to be used with an object with ownership other than __unsafe_unretained">;
-
// API notes
def err_apinotes_message : Error<"%0">;
def warn_apinotes_message : Warning<"%0">, InGroup<DiagGroup<"apinotes">>;
diff --git a/clang/include/clang/Config/config.h.cmake b/clang/include/clang/Config/config.h.cmake
index 27ed69e21562bf..805721237609b1 100644
--- a/clang/include/clang/Config/config.h.cmake
+++ b/clang/include/clang/Config/config.h.cmake
@@ -76,8 +76,6 @@
#cmakedefine01 PPC_LINUX_DEFAULT_IEEELONGDOUBLE
/* Enable each functionality of modules */
-#cmakedefine01 CLANG_ENABLE_ARCMT
-#cmakedefine01 CLANG_ENABLE_OBJC_REWRITER
#cmakedefine01 CLANG_ENABLE_STATIC_ANALYZER
/* Spawn a new process clang.exe for the CC1 tool invocation, when necessary */
diff --git a/clang/include/clang/Driver/Action.h b/clang/include/clang/Driver/Action.h
index 04fa8b01b418f8..bb9444d2e9ccdc 100644
--- a/clang/include/clang/Driver/Action.h
+++ b/clang/include/clang/Driver/Action.h
@@ -60,7 +60,6 @@ class Action {
PrecompileJobClass,
ExtractAPIJobClass,
AnalyzeJobClass,
- MigrateJobClass,
CompileJobClass,
BackendJobClass,
AssembleJobClass,
@@ -459,17 +458,6 @@ class AnalyzeJobAction : public JobAction {
}
};
-class MigrateJobAction : public JobAction {
- void anchor() override;
-
-public:
- MigrateJobAction(Action *Input, types::ID OutputType);
-
- static bool classof(const Action *A) {
- return A->getKind() == MigrateJobClass;
- }
-};
-
class CompileJobAction : public JobAction {
void anchor() override;
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index a89a4e8f8ec985..642d2a1268a002 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -692,20 +692,6 @@ def ccc_print_phases : Flag<["-"], "ccc-print-phases">,
def ccc_print_bindings : Flag<["-"], "ccc-print-bindings">, InternalDebugOpt,
HelpText<"Show bindings of tools to actions">;
-def ccc_arcmt_check : Flag<["-"], "ccc-arcmt-check">, InternalDriverOpt,
- HelpText<"Check for ARC migration issues that need manual handling">;
-def ccc_arcmt_modify : Flag<["-"], "ccc-arcmt-modify">, InternalDriverOpt,
- HelpText<"Apply modifications to files to conform to ARC">;
-def ccc_arcmt_migrate : Separate<["-"], "ccc-arcmt-migrate">, InternalDriverOpt,
- HelpText<"Apply modifications and produces temporary files that conform to ARC">;
-def arcmt_migrate_report_output : Separate<["-"], "arcmt-migrate-report-output">,
- HelpText<"Output path for the plist report">,
- Visibility<[ClangOption, CC1Option]>,
- MarshallingInfoString<FrontendOpts<"ARCMTMigrateReportOut">>;
-def arcmt_migrate_emit_arc_errors : Flag<["-"], "arcmt-migrate-emit-errors">,
- HelpText<"Emit ARC errors even if the migrator can fix them">,
- Visibility<[ClangOption, CC1Option]>,
- MarshallingInfoFlag<FrontendOpts<"ARCMTMigrateEmitARCErrors">>;
def gen_reproducer_eq: Joined<["-"], "gen-reproducer=">,
Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Emit reproducer on (option: off, crash (default), error, always)">;
@@ -721,87 +707,6 @@ def no_round_trip_args : Flag<["-"], "no-round-trip-args">,
Visibility<[CC1Option]>,
HelpText<"Disable command line arguments round-trip.">;
-def _migrate : Flag<["--"], "migrate">, Flags<[NoXarchOption]>,
- HelpText<"Run the migrator">;
-def ccc_objcmt_migrate : Separate<["-"], "ccc-objcmt-migrate">,
- InternalDriverOpt,
- HelpText<"Apply modifications and produces temporary files to migrate to "
- "modern ObjC syntax">;
-
-def objcmt_migrate_literals : Flag<["-"], "objcmt-migrate-literals">,
- Visibility<[ClangOption, CC1Option]>,
- HelpText<"Enable migration to modern ObjC literals">,
...
[truncated]
|
|
I see, we were talking about this earlier today and weren’t quite sure about that part. I presume we should keep that around for now then. Also, to clarify, does that include |
Yes, I believe that's essentially just a version of the rewriter that uses a different ABI (it tries to match the non-fragile Apple ObjC runtime rather than the fragile one). |
c9dfeb9
to
02ccfed
Compare
Ok, I’ve gone through the changes again and I think I managed to exclude anything pertaining to the rewriter from the removal. |
I’m not sure I got the CMake/Lit changes right though because I’m not really familiar w/ the CMake part of LLVM in general. |
Thanks! I use |
ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but please wait for @rjmccall to sign off before landing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks right to me, but let me tag in @akyrtzi just to make his own pass over this.
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/50/builds/9611 Here is the relevant piece of the build log for the reference
|
@@ -22,7 +22,7 @@ config.host_cxx = "@CMAKE_CXX_COMPILER@" | |||
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" | |||
config.have_zlib = @LLVM_ENABLE_ZLIB@ | |||
config.have_zstd = @LLVM_ENABLE_ZSTD@ | |||
config.clang_arcmt = @CLANG_ENABLE_ARCMT@ | |||
config.clang_objc_rewriter = "@CLANG_ENABLE_OBJC_REWRITER@" == "ON" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this, please add CLANG_ENABLE_OBJC_REWRITER
to the llvm_canonicalize_cmake_booleans
list at the top of clang/test/CMakeLists.txt and do clang_objc_rewriter = @CLANG_ENABLE_OBJC_REWRITER@
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering what the right way of doing this was; I’ll make a new pr for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #125117.
Thank you for this; this was a fantastic cleanup of tech debt! |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/136/builds/2593 Here is the relevant piece of the build log for the reference
|
In the discussion around #116792, @rjmccall mentioned that ARCMigrate has been obsoleted and that we could go ahead and remove it from Clang, so this patch does just that.
I searched for every mention of ‘ARCMT’/‘ARCMigrate’/‘ObjCRewrite’ and removed everything that seemed related to what I was able to find. I also had to touch a bunch of bazel and gn build scripts as part of this, neither of which I’m familiar with so it’s possible that I missed something there.