Skip to content

Commit 01fa7e4

Browse files
committed
remove debug stmts
1 parent 06352ff commit 01fa7e4

File tree

8 files changed

+17
-68
lines changed

8 files changed

+17
-68
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,6 @@ Driver::OpenMPRuntimeKind Driver::getOpenMPRuntime(const ArgList &Args) const {
769769

770770
void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
771771
InputList &Inputs) {
772-
/* salinas */ fprintf(
773-
stderr, "DAVE: Criver::CreateOffloadingDeviceToolChains ....\n");
774772
//
775773
// CUDA/HIP
776774
//
@@ -813,17 +811,14 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
813811
CudaInstallation.WarnIfUnsupportedVersion();
814812
}
815813
C.addOffloadDeviceToolChain(CudaTC.get(), OFK);
816-
} else if (IsHIP) { /* salinas */ fprintf(stderr,"\t creating HIP Offloading toolchain ...\n");
814+
} else if (IsHIP) {
817815
if (auto *OMPTargetArg =
818816
C.getInputArgs().getLastArg(options::OPT_fopenmp_targets_EQ)) {
819817
Diag(clang::diag::err_drv_unsupported_opt_for_language_mode)
820818
<< OMPTargetArg->getSpelling() << "HIP";
821819
return;
822820
}
823821
const ToolChain *HostTC = C.getSingleOffloadToolChain<Action::OFK_Host>();
824-
/* salinas */ fprintf(
825-
stderr,
826-
"Driver::CreateOffloadingDeviceToolChain .... OK got a HOST TC ...\n");
827822
auto OFK = Action::OFK_HIP;
828823
auto HIPTriple = getHIPOffloadTargetTriple(*this, C.getInputArgs());
829824
if (!HIPTriple)
@@ -6333,7 +6328,6 @@ std::string Driver::GetClPchPath(Compilation &C, StringRef BaseName) const {
63336328

63346329
const ToolChain &Driver::getToolChain(const ArgList &Args,
63356330
const llvm::Triple &Target) const {
6336-
/* salinas */ fprintf(stderr, "Driver::getToolChain() ... ->%s<-\n",Target.str().c_str() );
63376331
auto &TC = ToolChains[Target.str()];
63386332
if (!TC) {
63396333
switch (Target.getOS()) {
@@ -6521,17 +6515,11 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
65216515
const ToolChain &Driver::getOffloadingDeviceToolChain(
65226516
const ArgList &Args, const llvm::Triple &Target, const ToolChain &HostTC,
65236517
const Action::OffloadKind &TargetDeviceOffloadKind) const {
6524-
/* salinas */ fprintf(stderr,"===== Driver::getOffloadingDeviceToolChain() ....\n");
6525-
if (HostTC.getTriple().isWindowsMSVCEnvironment())
6526-
fprintf(stderr, "\t\t HOST TC IS WINDOWS !!!!!\n");
6527-
else
6528-
fprintf(stderr, "\t\t HOST TC is NOT Windows \n");
65296518

65306519
// Use device / host triples as the key into the ToolChains map because the
65316520
// device ToolChain we create depends on both.
65326521
auto &TC = ToolChains[Target.str() + "/" + HostTC.getTriple().str()];
65336522
if (!TC) {
6534-
/* salinas */ fprintf(stderr, "\t\t DIDN't GET a TC .....\n");
65356523
// Categorized by offload kind > arch rather than OS > arch like
65366524
// the normal getToolChain call, as it seems a reasonable way to categorize
65376525
// things.
@@ -6541,25 +6529,20 @@ const ToolChain &Driver::getOffloadingDeviceToolChain(
65416529
Target.getArch() == llvm::Triple::spirv64) &&
65426530
Target.getVendor() == llvm::Triple::AMD &&
65436531
Target.getOS() == llvm::Triple::AMDHSA) ||
6544-
!Args.hasArgNoClaim(options::OPT_offload_EQ)) /* salinas */ {
6545-
fprintf(stderr, "\t creating HIPAMDToolChain ...\n");
6532+
!Args.hasArgNoClaim(options::OPT_offload_EQ))
65466533
TC = std::make_unique<toolchains::HIPAMDToolChain>(
65476534
*this, Target, HostTC, Args);
6548-
} else if (Target.getArch() == llvm::Triple::spirv64 &&
6535+
else if (Target.getArch() == llvm::Triple::spirv64 &&
65496536
Target.getVendor() == llvm::Triple::UnknownVendor &&
6550-
Target.getOS() == llvm::Triple::UnknownOS) /* salinas */ {
6551-
fprintf(stderr, "\t creating HIPSPVToolChain\n");
6537+
Target.getOS() == llvm::Triple::UnknownOS)
65526538
TC = std::make_unique<toolchains::HIPSPVToolChain>(
6553-
*this, Target, HostTC, Args); /* salinas */
6554-
}
6539+
*this, Target, HostTC, Args);
65556540
break;
65566541
}
65576542
default:
65586543
break;
65596544
}
65606545
}
6561-
/* salinas */ fprintf(stderr,
6562-
"\t end of Driver::getOffloadDeviceToolChain\n");
65636546
return *TC;
65646547
}
65656548

clang/lib/Driver/ToolChains/AMDGPU.cpp

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@ bool RocmInstallationDetector::parseHIPVersionFile(llvm::StringRef V) {
180180
const SmallVectorImpl<RocmInstallationDetector::Candidate> &
181181
RocmInstallationDetector::getInstallationPathCandidates() {
182182

183-
/* salinas */ fprintf(stderr,"DAVE: RocmInstallationDetector::getInstallationPathCandidates() ...\n");
184-
185183
// Return the cached candidate list if it has already been populated.
186184
if (!ROCmSearchDirs.empty())
187185
return ROCmSearchDirs;
@@ -309,10 +307,7 @@ RocmInstallationDetector::getInstallationPathCandidates() {
309307
}
310308
}
311309

312-
fprintf(stderr,"DAVE: checking isHostWindows() ...\n"); /* salinas */
313-
314-
if (!isHostWindows()) { /* salinas */
315-
fprintf(stderr, "\t NOT WINDOWS ....\n");
310+
if (!isHostWindows()) {
316311

317312
if (!LatestROCm.empty())
318313
ROCmSearchDirs.emplace_back(D.SysRoot + "/opt/" + LatestROCm,
@@ -322,7 +317,7 @@ RocmInstallationDetector::getInstallationPathCandidates() {
322317
/*StrictChecking=*/true);
323318
ROCmSearchDirs.emplace_back(D.SysRoot + "/usr",
324319
/*StrictChecking=*/true);
325-
} /* salinas */ else fprintf(stderr,"\t IS WINDOWS!\n");
320+
}
326321

327322
DoPrintROCmSearchDirs();
328323
return ROCmSearchDirs;
@@ -333,7 +328,6 @@ RocmInstallationDetector::RocmInstallationDetector(
333328
const llvm::opt::ArgList &Args /*, SALINAS bool DetectHIPRuntime,
334329
bool DetectDeviceLib, bool isMSVC*/)
335330
: D(D), TargetTriple(TargetTriple) {
336-
/* salinas */ fprintf(stderr,"RocmInstallationDetector::RocmInstallationDetector() ... \n");
337331
/* SALINAS IsHostMSVC = isMSVC; */
338332
Verbose = Args.hasArg(options::OPT_v);
339333
RocmPathArg = Args.getLastArgValue(clang::driver::options::OPT_rocm_path_EQ);
@@ -388,9 +382,8 @@ RocmInstallationDetector::RocmInstallationDetector(
388382
.str();
389383
}
390384

391-
//if (DetectHIPRuntime) /* salinas */ {
392-
// fprintf(stderr, "DAVE: RocmInstallationDetector ctor: calling "
393-
// "detectHIPRuntime() ...\n");
385+
// SALINAS
386+
//if (DetectHIPRuntime)
394387
// detectHIPRuntime();
395388
//}
396389
//if (DetectDeviceLib)
@@ -450,7 +443,6 @@ void RocmInstallationDetector::detectDeviceLibrary() {
450443

451444
// Find device libraries in a legacy ROCm directory structure
452445
// ${ROCM_ROOT}/amdgcn/bitcode/*
453-
/* salinas */ fprintf(stderr,"DAVE 1: calling getInstallationPathCandidates()\n");
454446
auto &ROCmDirs = getInstallationPathCandidates();
455447
for (const auto &Candidate : ROCmDirs) {
456448
LibDevicePath = Candidate.Path;
@@ -461,11 +453,7 @@ void RocmInstallationDetector::detectDeviceLibrary() {
461453
}
462454
}
463455

464-
void RocmInstallationDetector::detectHIPRuntime() { /* salinas */
465-
fprintf(stderr, "DAVE: RocmInstallationDetector::detectHIPRuntime()\n");
466-
/* salinas */ std::optional<std::string> dave =
467-
llvm::sys::Process::GetEnv("HIP_PATH");
468-
/* salinas */ if (dave) fprintf(stderr, "DAVE: in detectHIPRuntime(): HIP_PATH = %s\n",(*dave).c_str());
456+
void RocmInstallationDetector::detectHIPRuntime() {
469457
SmallVector<Candidate, 4> HIPSearchDirs;
470458
if (!HIPPathArg.empty())
471459
HIPSearchDirs.emplace_back(HIPPathArg.str());
@@ -474,12 +462,8 @@ void RocmInstallationDetector::detectHIPRuntime() { /* salinas */
474462
if (!HIPPathEnv->empty())
475463
HIPSearchDirs.emplace_back(std::move(*HIPPathEnv));
476464
}
477-
if (HIPSearchDirs.empty()) { /* salinas */
478-
/* salinas */ fprintf(stderr,"DAVE 1: calling getInstallationPathCandidates()\n");
465+
if (HIPSearchDirs.empty())
479466
HIPSearchDirs.append(getInstallationPathCandidates());
480-
} /* salinas */ else
481-
fprintf(stderr,
482-
"DAVE: detectHIPRuntime() .... HIPSearchDirs is NOT empty!\n");
483467
auto &FS = D.getVFS();
484468

485469
for (const auto &Candidate : HIPSearchDirs) {
@@ -711,15 +695,12 @@ AMDGPUToolChain::AMDGPUToolChain(const Driver &D, const llvm::Triple &Triple,
711695
const ArgList &Args)
712696
: Generic_ELF(D, Triple, Args),
713697
OptionsDefault({{options::OPT_O, "3"},
714-
{options::OPT_cl_std_EQ, "CL1.2"}}) { /* salinas */
715-
fprintf(stderr, "========= DAVE =========== AMDGPUToolChain() ctor ....\n");
698+
{options::OPT_cl_std_EQ, "CL1.2"}}) {
716699
// Check code object version options. Emit warnings for legacy options
717700
// and errors for the last invalid code object version options.
718701
// It is done here to avoid repeated warning or error messages for
719702
// each tool invocation.
720703
checkAMDGPUCodeObjectVersion(D, Args);
721-
/* salinas */ fprintf(
722-
stderr, " ===== DVE: AMDGPUToolChain ctor END ..... =========\n");
723704
}
724705

725706
Tool *AMDGPUToolChain::buildLinker() const {
@@ -848,13 +829,10 @@ bool AMDGPUToolChain::isWave64(const llvm::opt::ArgList &DriverArgs,
848829
/// ROCM Toolchain
849830
ROCMToolChain::ROCMToolChain(const Driver &D, const llvm::Triple &Triple,
850831
const ArgList &Args, bool isHostTCMSVC)
851-
: AMDGPUToolChain(D, Triple, Args) { /* salinas */ fprintf(stderr,"DAVE: ROCMToolChain::ROCMToolChain() ...\n");
852-
/* salinas */ fprintf(
853-
stderr, "DAVE: in ROCMToolChain ctor calling setHostWindows()\n");
832+
: AMDGPUToolChain(D, Triple, Args) {
854833
RocmInstallation->setHostWindows(isHostTCMSVC);
855834

856835
RocmInstallation->detectDeviceLibrary();
857-
/* salinas */ fprintf(stderr, "DAVE: end of ROCMToolChain ctor\n");
858836
}
859837

860838
void AMDGPUToolChain::addClangTargetOptions(

clang/lib/Driver/ToolChains/Darwin.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,8 +932,6 @@ MachO::MachO(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
932932
Darwin::Darwin(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
933933
: MachO(D, Triple, Args), TargetInitialized(false),
934934
CudaInstallation(D, Triple, Args), RocmInstallation(D, Triple, Args) {
935-
/* SALINAS*/
936-
RocmInstallation->init();
937935
}
938936

939937
types::ID MachO::LookupTypeForExtension(StringRef Ext) const {

clang/lib/Driver/ToolChains/Gnu.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3050,11 +3050,6 @@ Generic_GCC::Generic_GCC(const Driver &D, const llvm::Triple &Triple,
30503050
: ToolChain(D, Triple, Args), GCCInstallation(D),
30513051
CudaInstallation(D, Triple, Args), RocmInstallation(D, Triple, Args) {
30523052
getProgramPaths().push_back(getDriver().Dir);
3053-
/* SALINAS */
3054-
/* salinas */ fprintf(
3055-
stderr,
3056-
" +++++++++ Generic_GCC ctor ... about to call rocninstall init ...\n");
3057-
//RocmInstallation->init();
30583053
}
30593054

30603055
Generic_GCC::~Generic_GCC() {}

clang/lib/Driver/ToolChains/HIPAMD.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void AMDGCN::Linker::ConstructJob(Compilation &C, const JobAction &JA,
250250

251251
HIPAMDToolChain::HIPAMDToolChain(const Driver &D, const llvm::Triple &Triple,
252252
const ToolChain &HostTC, const ArgList &Args)
253-
: ROCMToolChain(D, Triple, Args, HostTC.getTriple().isWindowsMSVCEnvironment()), HostTC(HostTC) { /* salinas */ fprintf(stderr,"DAVE: HIPAMDToolChain::HIPAMDToolChain() ...\n");
253+
: ROCMToolChain(D, Triple, Args, HostTC.getTriple().isWindowsMSVCEnvironment()), HostTC(HostTC) {
254254
// Lookup binaries into the driver directory, this is used to
255255
// discover the clang-offload-bundler executable.
256256
getProgramPaths().push_back(getDriver().Dir);
@@ -265,7 +265,6 @@ HIPAMDToolChain::HIPAMDToolChain(const Driver &D, const llvm::Triple &Triple,
265265
D.getDiags().Report(clang::diag::warn_drv_unsupported_option_for_target)
266266
<< A->getAsString(Args) << getTriple().str();
267267
}
268-
/* salinas */ fprintf(stderr, "DAVE: end of HIPAMDToolChain ctor\n");
269268
}
270269

271270
void HIPAMDToolChain::addClangTargetOptions(

clang/lib/Driver/ToolChains/MSVC.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,7 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
427427
MSVCToolChain::MSVCToolChain(const Driver &D, const llvm::Triple &Triple,
428428
const ArgList &Args)
429429
: ToolChain(D, Triple, Args), CudaInstallation(D, Triple, Args),
430-
RocmInstallation(D, Triple, Args) { /* salinas */ fprintf(stderr,"DAVE: MSVCToolChain::MSVCToolChain() ... \n");
431-
/* salnas */ fprintf(stderr,
432-
"DAVE in MSVCToolChain ctor calling setHostWindows()\n");
430+
RocmInstallation(D, Triple, Args) {
433431
RocmInstallation->setHostWindows(true);
434432
/* SALINAS */
435433
RocmInstallation->init();
@@ -459,8 +457,6 @@ MSVCToolChain::MSVCToolChain(const Driver &D, const llvm::Triple &Triple,
459457
llvm::findVCToolChainViaSetupConfig(getVFS(), VCToolsVersion,
460458
VCToolChainPath, VSLayout) ||
461459
llvm::findVCToolChainViaRegistry(VCToolChainPath, VSLayout);
462-
463-
/* salinas */ fprintf(stderr, "DAVE: end of MSVC ToolChain ctor\n");
464460
}
465461

466462
Tool *MSVCToolChain::buildLinker() const {

clang/lib/Driver/ToolChains/ROCm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class RocmInstallationDetector {
199199

200200
/// Check whether the target triple is for Windows.
201201
bool isHostWindows() const { return IsHostMSVC; }
202-
void setHostWindows(bool val) { IsHostMSVC=val; /* salinas */ fprintf(stderr,"DAVE: RocmInstallationDetector::setHostWindows()\n"); }
202+
void setHostWindows(bool val) { IsHostMSVC=val;}
203203

204204
/// Print information about the detected ROCm installation.
205205
void print(raw_ostream &OS) const;

clang/test/Driver/rocm-detect-windows.hip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Test to ensure that on Windows, we do not include linux sesrch paths
44
// RUN: %clang -### -nogpulib -nogpuinc \
55
// RUN: --print-rocm-search-dirs %s 2>&1 \
6-
// RUN: | FileCheck %s --dump-input-context 100
6+
// RUN: | FileCheck %s
77

88
// CHECK-NOT: ROCm installation search path: {{/usr/local}}
99
// CHECK-NOT: ROCm installation search path: {{/usr}}

0 commit comments

Comments
 (0)