Fix unused function warnings for conditionally used functions
Change-Id: Ied23c571b949abef1816914986f19b14aca3d2f3
This commit is contained in:
committad av
Matthew Arsenault
förälder
7124974148
incheckning
c56a82fd05
@@ -1440,12 +1440,6 @@ Options::setPerBuildInfo(
|
||||
}
|
||||
|
||||
|
||||
static inline bool isFullPath(const std::string &path)
|
||||
{
|
||||
size_t found = path.find(":");
|
||||
return found != std::string::npos;
|
||||
}
|
||||
|
||||
// HashString - Hash function for strings.
|
||||
// This is the Bernstein hash function.
|
||||
static inline unsigned HashString(std::string Str, unsigned Result = 0)
|
||||
@@ -1475,19 +1469,19 @@ static void splitFileName(const std::string &fileName, std::string &path, std::s
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
static inline bool isFullPath(const std::string &path)
|
||||
{
|
||||
size_t found = path.find(":");
|
||||
return found != std::string::npos;
|
||||
}
|
||||
|
||||
static std::string getValidDumpPath(const std::string &path)
|
||||
{
|
||||
if (path.empty()) {
|
||||
return path;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
const std::string curPath = path + ".";
|
||||
long pathname_max = pathconf(curPath.c_str(), _PC_PATH_MAX);
|
||||
assert(pathname_max != -1 && path.size() < static_cast<unsigned long>(pathname_max));
|
||||
return path;
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
std::string validPath;
|
||||
unsigned long pathname_max = _MAX_PATH;
|
||||
if (path.size() > pathname_max) {
|
||||
@@ -1504,9 +1498,24 @@ static std::string getValidDumpPath(const std::string &path)
|
||||
} else
|
||||
validPath = path;
|
||||
return validPath;
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static std::string getValidDumpPath(const std::string &path)
|
||||
{
|
||||
if (path.empty()) {
|
||||
return path;
|
||||
}
|
||||
|
||||
const std::string curPath = path + ".";
|
||||
long pathname_max = pathconf(curPath.c_str(), _PC_PATH_MAX);
|
||||
assert(pathname_max != -1 && path.size() < static_cast<unsigned long>(pathname_max));
|
||||
return path;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static std::string getValidDumpBaseName(const std::string &path, const std::string &file,
|
||||
long basename_max, const std::string &ext)
|
||||
{
|
||||
|
||||
@@ -42,14 +42,14 @@ extern int SearchProfileOfAnApplication(const wchar_t* fileName,
|
||||
ADLApplicationProfile** lppProfile);
|
||||
#endif // BRAHMA
|
||||
|
||||
static void* __stdcall adlMallocCallback(int n) { return malloc(n); }
|
||||
|
||||
#define GETPROCADDRESS(_adltype_, _adlfunc_) (_adltype_) amd::Os::getSymbol(adlHandle_, #_adlfunc_);
|
||||
|
||||
namespace amd {
|
||||
|
||||
#if !defined(BRAHMA) && !defined(WITH_LIGHTNING_COMPILER)
|
||||
|
||||
static void* __stdcall adlMallocCallback(int n) { return malloc(n); }
|
||||
|
||||
class ADL {
|
||||
public:
|
||||
ADL();
|
||||
|
||||
@@ -727,9 +727,12 @@ bool Program::compileImplLC(const std::string& sourceCode,
|
||||
|
||||
|
||||
// ================================================================================================
|
||||
|
||||
#if defined(WITH_COMPILER_LIB)
|
||||
static void logFunction(const char* msg, size_t size) {
|
||||
std::cout << "Compiler Log: " << msg << std::endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
// ================================================================================================
|
||||
bool Program::compileImplHSAIL(const std::string& sourceCode,
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
|
||||
namespace roc {
|
||||
|
||||
#if defined(WITH_COMPILER_LIB)
|
||||
static hsa_status_t GetKernelNamesCallback(hsa_executable_t exec, hsa_agent_t agent,
|
||||
hsa_executable_symbol_t symbol, void* data) {
|
||||
std::vector<std::string>* symNameList = reinterpret_cast<std::vector<std::string>*>(data);
|
||||
@@ -62,6 +63,7 @@ static hsa_status_t GetKernelNamesCallback(hsa_executable_t exec, hsa_agent_t ag
|
||||
|
||||
return HSA_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline const char* hsa_strerror(hsa_status_t status) {
|
||||
const char* str = nullptr;
|
||||
|
||||
Referens i nytt ärende
Block a user