mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-26 14:25:18 +00:00
AMDGPU: Fix getIntegerAttribute type and error message
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269268 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f058cfd499
commit
b381ae290d
@ -109,18 +109,18 @@ bool isReadOnlySegment(const GlobalValue *GV) {
|
||||
return GV->getType()->getAddressSpace() == AMDGPUAS::CONSTANT_ADDRESS;
|
||||
}
|
||||
|
||||
static unsigned getIntegerAttribute(const Function &F, const char *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;
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,8 @@ bool isGroupSegment(const GlobalValue *GV);
|
||||
bool isGlobalSegment(const GlobalValue *GV);
|
||||
bool isReadOnlySegment(const GlobalValue *GV);
|
||||
|
||||
int getIntegerAttribute(const Function &F, StringRef Name, int Default);
|
||||
|
||||
unsigned getMaximumWorkGroupSize(const Function &F);
|
||||
unsigned getInitialPSInputAddr(const Function &F);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user