Commit 5ad88623 authored by Brad King's avatar Brad King
Browse files

Source: Convince NVHPC that RAII variables are used

parent 1898f9dd
...@@ -90,6 +90,9 @@ struct LoadedCommandImpl : cmLoadedCommandInfo ...@@ -90,6 +90,9 @@ struct LoadedCommandImpl : cmLoadedCommandInfo
{ {
if (this->Destructor) { if (this->Destructor) {
SignalHandlerGuard guard(this->Name); SignalHandlerGuard guard(this->Name);
#if defined(__NVCOMPILER)
static_cast<void>(guard); // convince compiler var is used
#endif
this->Destructor(this); this->Destructor(this);
} }
if (this->Error != nullptr) { if (this->Error != nullptr) {
...@@ -103,12 +106,18 @@ struct LoadedCommandImpl : cmLoadedCommandInfo ...@@ -103,12 +106,18 @@ struct LoadedCommandImpl : cmLoadedCommandInfo
int DoInitialPass(cmMakefile* mf, int argc, char* argv[]) int DoInitialPass(cmMakefile* mf, int argc, char* argv[])
{ {
SignalHandlerGuard guard(this->Name); SignalHandlerGuard guard(this->Name);
#if defined(__NVCOMPILER)
static_cast<void>(guard); // convince compiler var is used
#endif
return this->InitialPass(this, mf, argc, argv); return this->InitialPass(this, mf, argc, argv);
} }
void DoFinalPass(cmMakefile* mf) void DoFinalPass(cmMakefile* mf)
{ {
SignalHandlerGuard guard(this->Name); SignalHandlerGuard guard(this->Name);
#if defined(__NVCOMPILER)
static_cast<void>(guard); // convince compiler var is used
#endif
this->FinalPass(this, mf); this->FinalPass(this, mf);
} }
}; };
......
...@@ -2723,6 +2723,9 @@ void cmQtAutoMocUicT::CreateParseJobs(SourceFileMapT const& sourceMap) ...@@ -2723,6 +2723,9 @@ void cmQtAutoMocUicT::CreateParseJobs(SourceFileMapT const& sourceMap)
std::string cmQtAutoMocUicT::CollapseFullPathTS(std::string const& path) const std::string cmQtAutoMocUicT::CollapseFullPathTS(std::string const& path) const
{ {
std::lock_guard<std::mutex> guard(this->CMakeLibMutex_); std::lock_guard<std::mutex> guard(this->CMakeLibMutex_);
#if defined(__NVCOMPILER)
static_cast<void>(guard); // convince compiler var is used
#endif
return cmSystemTools::CollapseFullPath(path, return cmSystemTools::CollapseFullPath(path,
this->ProjectDirs().CurrentSource); this->ProjectDirs().CurrentSource);
} }
...@@ -2962,6 +2965,9 @@ std::vector<std::string> cmQtAutoMocUicT::dependenciesFromDepFile( ...@@ -2962,6 +2965,9 @@ std::vector<std::string> cmQtAutoMocUicT::dependenciesFromDepFile(
const char* filePath) const char* filePath)
{ {
std::lock_guard<std::mutex> guard(this->CMakeLibMutex_); std::lock_guard<std::mutex> guard(this->CMakeLibMutex_);
#if defined(__NVCOMPILER)
static_cast<void>(guard); // convince compiler var is used
#endif
auto const content = cmReadGccDepfile(filePath); auto const content = cmReadGccDepfile(filePath);
if (!content || content->empty()) { if (!content || content->empty()) {
return {}; return {};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment