Skip to content

Commit aadc521

Browse files
author
Salinas, David
authored
Disable flang warning, its erroneously firing on all uses (llvm#3444)
2 parents 580ad88 + c013b65 commit aadc521

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

clang/lib/Driver/ToolChain.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,23 @@ ParsedClangName
483483
ToolChain::getTargetAndModeFromProgramName(StringRef PN) {
484484
std::string ProgName = normalizeProgramName(PN);
485485
size_t SuffixPos;
486+
bool FlangNew = false;
486487
const DriverSuffix *DS = parseDriverSuffix(ProgName, SuffixPos);
488+
489+
// Part II: Warn if invocation happens with flang-new (for Flang); this is for
490+
// the time being and should be removed once AMD Classic Flang has been
491+
// removed from ROCm.
492+
if (FlangNew) {
493+
// flang-new warning is overwarning, disabling until fixed.
494+
if (false && !::getenv("AMD_NOWARN_FLANG_NEW")) {
495+
// The solution with "llvm::errs()" is not ideal, but the driver object
496+
// is not been constructed yet, so we cannot use the Diag() infrastructure
497+
// for this.
498+
llvm::errs() << "warning: the 'amdflang-new' and 'flang-new' commmands "
499+
"have been deprecated; please use 'amdflang' instead\n";
500+
}
501+
}
502+
487503
if (!DS)
488504
return {};
489505
size_t SuffixEnd = SuffixPos + strlen(DS->Suffix);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
! RUN: amdflang-new -c %s 2>&1 | FileCheck %s
2+
! CHECK: warning: the 'amdflang-new' and 'flang-new' commmands have been deprecated; please use 'amdflang' instead
3+
! XFAIL: *

0 commit comments

Comments
 (0)