Skip to content

Revert "[Clang] Add resource_dir_EQ flag to CC1Option group (#140870)" #142509

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

Merged

Conversation

wenju-he
Copy link
Contributor

@wenju-he wenju-he commented Jun 3, 2025

This reverts commit c7b8d6e.
Fix check-clang CodeGenTest.TestNonAlterTest regression, see
#140870 (comment)

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jun 3, 2025
@wenju-he wenju-he requested a review from nathanchance June 3, 2025 01:02
@llvmbot
Copy link
Member

llvmbot commented Jun 3, 2025

@llvm/pr-subscribers-clang

Author: Wenju He (wenju-he)

Changes

This reverts commit c7b8d6e.
Fix check-clang CodeGenTest.TestNonAlterTest regression, see
#140870 (comment)


Full diff: https://github.com/llvm/llvm-project/pull/142509.diff

2 Files Affected:

  • (modified) clang/include/clang/Driver/Options.td (+1-1)
  • (modified) clang/unittests/Tooling/ToolingTest.cpp (-19)
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 5ca31c253ed8f..aa303b91b8808 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -5897,7 +5897,7 @@ def resource_dir : Separate<["-"], "resource-dir">,
   HelpText<"The directory which holds the compiler resource files">,
   MarshallingInfoString<HeaderSearchOpts<"ResourceDir">>;
 def resource_dir_EQ : Joined<["-"], "resource-dir=">, Flags<[NoXarchOption]>,
-  Visibility<[ClangOption, CC1Option, CLOption, DXCOption, FlangOption]>,
+  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
   Alias<resource_dir>;
 def rpath : Separate<["-"], "rpath">, Flags<[LinkerInput]>, Group<Link_Group>,
   Visibility<[ClangOption, FlangOption]>;
diff --git a/clang/unittests/Tooling/ToolingTest.cpp b/clang/unittests/Tooling/ToolingTest.cpp
index 562f87d430e6f..32af4b6b3b359 100644
--- a/clang/unittests/Tooling/ToolingTest.cpp
+++ b/clang/unittests/Tooling/ToolingTest.cpp
@@ -771,25 +771,6 @@ TEST(ClangToolTest, BaseVirtualFileSystemUsage) {
   EXPECT_EQ(0, Tool.run(Action.get()));
 }
 
-// Check -cc1 command doesn't fail.
-TEST(ClangToolTest, CC1Arg) {
-  FixedCompilationDatabase Compilations("/", {"-cc1"});
-  llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFileSystem(
-      new llvm::vfs::OverlayFileSystem(llvm::vfs::getRealFileSystem()));
-  llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFileSystem(
-      new llvm::vfs::InMemoryFileSystem);
-  OverlayFileSystem->pushOverlay(InMemoryFileSystem);
-
-  InMemoryFileSystem->addFile(
-      "a.cpp", 0, llvm::MemoryBuffer::getMemBuffer("int main() {}"));
-
-  ClangTool Tool(Compilations, std::vector<std::string>(1, "a.cpp"),
-                 std::make_shared<PCHContainerOperations>(), OverlayFileSystem);
-  std::unique_ptr<FrontendActionFactory> Action(
-      newFrontendActionFactory<SyntaxOnlyAction>());
-  EXPECT_EQ(0, Tool.run(Action.get()));
-}
-
 // Check getClangStripDependencyFileAdjuster doesn't strip args after -MD/-MMD.
 TEST(ClangToolTest, StripDependencyFileAdjuster) {
   FixedCompilationDatabase Compilations("/", {"-MD", "-c", "-MMD", "-w"});

Copy link
Member

@nathanchance nathanchance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, did not realize you were waiting on me to review. I am still reverting this locally so LGTM.

@wenju-he
Copy link
Contributor Author

wenju-he commented Jun 7, 2025

thank you @nathanchance for the review.

@wenju-he wenju-he merged commit 8a51fb2 into main Jun 7, 2025
13 checks passed
@wenju-he wenju-he deleted the revert-140870-ClangTool-injectResourceDir-use-CC1Option branch June 7, 2025 00:05
rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
)" (llvm#142509)

This reverts commit c7b8d6e.
Fix check-clang CodeGenTest.TestNonAlterTest regression, see
llvm#140870 (comment)
DhruvSrivastavaX pushed a commit to DhruvSrivastavaX/lldb-for-aix that referenced this pull request Jun 12, 2025
)" (llvm#142509)

This reverts commit c7b8d6e.
Fix check-clang CodeGenTest.TestNonAlterTest regression, see
llvm#140870 (comment)
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
)" (llvm#142509)

This reverts commit c7b8d6e.
Fix check-clang CodeGenTest.TestNonAlterTest regression, see
llvm#140870 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants