Skip to content

Commit 8621841

Browse files
pszymichlwesiers
authored andcommitted
Rename the "__unused" definition for CentOS builds
to pass. The name clashes with several files from CentOS /usr/include/bits directory. Change-Id: I6121fab916021503c76195578c8733e1174f21e0
1 parent 7adfd76 commit 8621841

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

IGC/AdaptorOCL/SPIRV/SPIRVInternal.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ namespace spv {
104104
using namespace llvm;
105105

106106
namespace kOCLTypeQualifierName {
107-
__unused const static char *Const = "const";
108-
__unused const static char *Volatile = "volatile";
109-
__unused const static char *Restrict = "restrict";
110-
__unused const static char *Pipe = "pipe";
107+
__attr_unused const static char *Const = "const";
108+
__attr_unused const static char *Volatile = "volatile";
109+
__attr_unused const static char *Restrict = "restrict";
110+
__attr_unused const static char *Pipe = "pipe";
111111
}
112112

113113
template<> inline void

IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ isOpenCLKernel(SPIRVFunction *BF) {
104104
return BF->getModule()->isEntryPoint(ExecutionModelKernel, BF->getId());
105105
}
106106

107-
__unused static void
107+
__attr_unused static void
108108
dumpLLVM(Module *M, const std::string &FName) {
109109
std::error_code EC;
110110
raw_fd_ostream FS(FName, EC, sys::fs::F_None);
@@ -3967,7 +3967,7 @@ SPIRVToLLVM::transCompilerOption() {
39673967
return true;
39683968
}
39693969

3970-
__unused static void dumpSPIRVBC(const char* fname, const char* data, unsigned int size)
3970+
__attr_unused static void dumpSPIRVBC(const char* fname, const char* data, unsigned int size)
39713971
{
39723972
FILE* fp;
39733973
fp = fopen(fname, "wb");

IGC/Compiler/CISACodeGen/AdvCodeMotion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ namespace {
7777
}
7878

7979
bool hoistUniform(BasicBlock* Src, BasicBlock* Dst) const;
80-
__unused bool hoistMost(bool InvPred, BasicBlock* IfBB,
80+
__attr_unused bool hoistMost(bool InvPred, BasicBlock* IfBB,
8181
BasicBlock* TBB, BasicBlock* FBB, BasicBlock* JBB) const;
8282
bool hoistMost2(bool InvPred, BasicBlock* IfBB,
8383
BasicBlock* TBB, BasicBlock* FBB, BasicBlock* JBB) const;

IGC/Compiler/CISACodeGen/CISACodeGen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ namespace IGC
106106

107107
#define DECLARE_CISA_OPCODE(opCode, name, visaname) \
108108
visaname,
109-
__unused static ISA_Opcode ConvertOpcode[] =
109+
__attr_unused static ISA_Opcode ConvertOpcode[] =
110110
{
111111
#include "isaDef.def"
112112
};

IGC/GenISAIntrinsics/GenIntrinsics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ ID getIntrinsicForGCCBuiltin(const char *Prefix, const char *BuiltinName);
5959

6060
/// Intrinsic::isOverloaded(ID) - Returns true if the intrinsic can be
6161
/// overloaded.
62-
__unused static bool isOverloaded(ID id);
62+
__attr_unused static bool isOverloaded(ID id);
6363

6464
/// IITDescriptor - This is a type descriptor which explains the type
6565
/// requirements of an intrinsic. This is returned by

inc/common/UFO/portable_compiler.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4646
#define __thread __declspec(thread)
4747
#define __builtin_popcount __popcnt
4848

49-
#define __unused
49+
#define __attr_unused
5050

5151
#elif defined(__clang__)
5252

@@ -78,8 +78,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7878
#endif
7979
#define __popcnt __builtin_popcount
8080

81-
#ifndef __unused
82-
#define __unused __attribute__((unused))
81+
#ifndef __attr_unused
82+
#define __attr_unused __attribute__((unused))
8383
#endif
8484

8585
#elif __GNUC__
@@ -113,7 +113,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
113113
#define __debugbreak() do { asm volatile ("int3;"); } while (0)
114114
#define __popcnt __builtin_popcount
115115

116-
#define __unused __attribute__((unused))
116+
#define __attr_unused __attribute__((unused))
117117

118118
#else
119119

0 commit comments

Comments
 (0)