Skip to content

[ObjectiveC] -rewrite-objc was treating inputs as preprocessed files #137623

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
merged 2 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ static void addDashXForInput(const ArgList &Args, const InputInfo &Input,

CmdArgs.push_back("-x");
if (Args.hasArg(options::OPT_rewrite_objc))
CmdArgs.push_back(types::getTypeName(types::TY_PP_ObjCXX));
CmdArgs.push_back(types::getTypeName(types::TY_ObjCXX));
else {
// Map the driver type to the frontend type. This is mostly an identity
// mapping, except that the distinction between module interface units
Expand Down
5 changes: 5 additions & 0 deletions clang/test/Driver/rewrite-objc-preproc.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// RUN: %clang --target=x86_64-apple-macosx10.7.0 -rewrite-objc %s -o - -### 2>&1 | \
// RUN: FileCheck %s
//
// Check that we're running a preprocessing stage passing a not-preprocessed objective-c++ file as input
// CHECK: "-E"{{.*}}"-x" "objective-c++"