Workaround for --help output being truncated when redirecting to file.

This commit is contained in:
David Nadlinger
2012-10-07 15:08:24 +02:00
parent 9c3bb1ecd3
commit 0777102e9d

View File

@@ -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);
}