From 0777102e9dfd50bd757b71e35263d72c0727fc8d Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sun, 7 Oct 2012 15:08:24 +0200 Subject: [PATCH] Workaround for --help output being truncated when redirecting to file. --- driver/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/driver/main.cpp b/driver/main.cpp index 949d38e8..a277a424 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -96,6 +96,11 @@ void printVersion() { if (CPU == "generic") CPU = "(unknown)"; printf(" Host CPU: %s\n", CPU.c_str()); printf("\n"); + + // Without explicitly flushing here, only the target list is visible when + // redirecting stdout to a file. + fflush(stdout); + llvm::TargetRegistry::printRegisteredTargetsForVersion(); exit(EXIT_SUCCESS); }