Index: lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h =================================================================== --- lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h +++ lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h @@ -45,8 +45,7 @@ bool isGlobalSegment(const GlobalValue *GV); bool isReadOnlySegment(const GlobalValue *GV); -unsigned getIntegerAttribute(const Function &F, StringRef Name, - unsigned Default); +int getIntegerAttribute(const Function &F, StringRef Name, int Default); unsigned getMaximumWorkGroupSize(const Function &F); unsigned getInitialPSInputAddr(const Function &F); Index: lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp =================================================================== --- lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp +++ lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp @@ -109,18 +109,18 @@ return GV->getType()->getAddressSpace() == AMDGPUAS::CONSTANT_ADDRESS; } -unsigned getIntegerAttribute(const Function &F, StringRef Name, - unsigned Default) { +int getIntegerAttribute(const Function &F, StringRef Name, int Default) { Attribute A = F.getFnAttribute(Name); - unsigned Result = Default; + int Result = Default; if (A.isStringAttribute()) { StringRef Str = A.getValueAsString(); if (Str.getAsInteger(0, Result)) { LLVMContext &Ctx = F.getContext(); - Ctx.emitError("can't parse shader type"); + Ctx.emitError("can't parse integer attribute " + Name); } } + return Result; }