mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Driver/Frontend] Add -print-target-triple
Add a -print-target-triple command line option to the Swift frontend and driver to allow other tools (e.g., SwiftPM) to query the host triple as it is understood by the Swift compiler. This follows the precedent set by Clang. Implements rdar://problem/57434967.
This commit is contained in:
@@ -1987,6 +1987,11 @@ int swift::performFrontend(ArrayRef<const char *> Args,
|
||||
return finishDiagProcessing(0);
|
||||
}
|
||||
|
||||
if (Invocation.getFrontendOptions().PrintTargetTriple) {
|
||||
llvm::outs() << Invocation.getLangOptions().Target.getTriple() << "\n";
|
||||
return finishDiagProcessing(0);
|
||||
}
|
||||
|
||||
if (Invocation.getFrontendOptions().RequestedAction ==
|
||||
FrontendOptions::ActionType::NoneAction) {
|
||||
Instance->getDiags().diagnose(SourceLoc(),
|
||||
|
||||
Reference in New Issue
Block a user