AMDGPU: Fix getIntegerAttribute type and error message
llvm-svn: 269268
This commit is contained in:
parent
a94e383157
commit
8300272823
|
@ -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…
Reference in New Issue