Fix unused-function warnings and enable -Wunused-function (#1576)

Move functions in .h files to .cpp files where appropriate; align
prototypes and definitions; and remove functions that are not used.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2022-12-13 17:47:48 +00:00
committed by GitHub
parent 58eb3d776d
commit 3cadff7115
9 changed files with 193 additions and 273 deletions

View File

@@ -124,23 +124,6 @@ void dealloc(T *p)
if (p) delete p;
}
static bool is_dir_exits(const char* path)
{
assert(path && "NULL directory");
#if defined(_WIN32)
DWORD ftyp = GetFileAttributesA(path);
if (ftyp != INVALID_FILE_ATTRIBUTES && (ftyp & FILE_ATTRIBUTE_DIRECTORY))
return true;
#else // Linux assumed here.
if (DIR *pDir = opendir(path))
{
closedir(pDir);
return true;
}
#endif
return false;
}
static void get_spir_version(cl_device_id device,
std::vector<Version> &versions)
{
@@ -205,21 +188,6 @@ static void printError(const std::string& S){
std::cerr << S << std::endl;
}
static bool extractKernelAttribute(std::string& kernel_attributes,
const std::string& attribute, std::vector<std::string>& attribute_vector) {
size_t start = kernel_attributes.find(attribute + "(");
if (start == 0) {
size_t end = kernel_attributes.find(")", start);
if (end != std::string::npos) {
size_t length = end-start+1;
attribute_vector.push_back(kernel_attributes.substr(start, length));
kernel_attributes.erase(start, length);
return true;
}
}
return false;
}
// Extracts suite with the given name, and saves it to disk.
static void extract_suite(const char *suiteName)
{
@@ -6454,7 +6422,8 @@ std::vector<std::string> &split(const std::string &s, char delim, std::vector<st
return elems;
}
// Temporarily disabled, see GitHub #1284
#if 0
static bool
test_kernel_attributes(cl_device_id device, cl_uint width, const char *folder)
{
@@ -6539,6 +6508,7 @@ test_kernel_attributes(cl_device_id device, cl_uint width, const char *folder)
std::cout << std::endl;
return success;
}
#endif
static bool test_binary_type(cl_device_id device, cl_uint width, const char *folder)
{