Skip to content

Commit d56f63b

Browse files
Removed debug code, updated comments
1 parent e1a112e commit d56f63b

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

flang/tools/flang-driver/fc1_main.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ static int printSupportedCPUs(llvm::StringRef triple) {
5454
/// Check that given CPU is valid for given target.
5555
static bool checkSupportedCPU(clang::DiagnosticsEngine& diags, llvm::StringRef str_cpu, llvm::StringRef str_triple) {
5656

57-
llvm::errs() << "EE str_cpu = '" << str_cpu << "', str_triple = '" << str_triple << "'\n";
5857
llvm::Triple triple{str_triple};
58+
59+
// Need to check for empty CPU string, because it can be empty for some
60+
// cases, e.g., "-x cuda" compilation.
5961
if (triple.getArch() == llvm::Triple::x86_64 && !str_cpu.empty()) {
60-
const bool only64bit{true};
62+
constexpr bool only64bit{true};
6163
llvm::X86::CPUKind x86cpu = llvm::X86::parseArchX86(str_cpu, only64bit);
6264
if (x86cpu == llvm::X86::CK_None) {
6365
diags.Report(clang::diag::err_target_unknown_cpu) << str_cpu;
@@ -70,7 +72,8 @@ static bool checkSupportedCPU(clang::DiagnosticsEngine& diags, llvm::StringRef s
7072
}
7173
}
7274

73-
// TODO: only support check for x86_64 for now. Anything else passes.
75+
// TODO: only support check for x86_64 for now. Anything else is considered
76+
// as "supported".
7477
return true;
7578
}
7679

@@ -83,12 +86,6 @@ int fc1_main(llvm::ArrayRef<const char *> argv, const char *argv0) {
8386
if (!flang->hasDiagnostics())
8487
return 1;
8588

86-
llvm::errs() << "EE args: ";
87-
for (auto arg : argv) {
88-
llvm::errs() << "\"" << arg << "\" ";
89-
}
90-
llvm::errs() << "\n";
91-
9289
// We will buffer diagnostics from argument parsing so that we can output
9390
// them using a well formed diagnostic object.
9491
TextDiagnosticBuffer *diagsBuffer = new TextDiagnosticBuffer;

0 commit comments

Comments
 (0)