Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Make RemapClangImporterOptions more robust. #1302

Merged
merged 1 commit into from Feb 19, 2019

Conversation

adrian-prantl
Copy link
Member

Due to a bug absolute path remapping would be applied to -iquote
options rather than their arguments. The fixed code only whitelists
a few search path options that it actually understands.

rdar://problem/48078809

@adrian-prantl
Copy link
Member Author

@swift-ci test and merge


if (!remap_next) {
/* previous argument was -iquote */;
} else if (arg == "-I" || arg == "-F" || arg == "-iquote") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Clang allows -iquote to be used in joined form as well (e.g., -iquotefoo/bar is legal): https://github.com/llvm/llvm-project/blob/fcbec02/clang/include/clang/Driver/Options.td#L1951-L1952

Does that case need to be handled here as well? It's ugly, but we actually use it in our Swift Bazel rules to remove some excess <space>-Xcc<space>s in our command lines.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Due to a bug absolute path remapping would be applied to -iquote
*options* rather than their arguments. The fixed code only whitelists
a few search path options that it actually understands.

This patch also adds support for -iquote/some/path.

rdar://problem/48078809
@adrian-prantl
Copy link
Member Author

@swift-ci test

@adrian-prantl adrian-prantl merged commit 5b094c2 into apple:swift-5.1-branch Feb 19, 2019
@DavidGoldman
Copy link
Contributor

@adrian-prantl Is it possible to merge this into the Swift 5.0 branch?

@adrian-prantl
Copy link
Member Author

@DavidGoldman it is! -> #1305

@DavidGoldman
Copy link
Contributor

Thanks, is it in an Xcode 10.2 beta?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants