aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2016-05-12 02:45:18 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2016-05-12 02:45:18 +0000
commit8300272823108eb17f01af51c4d54ef5018a5e6d (patch)
tree978df737534288027f494e56a063a7a3f7d7e516 /llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
parenta94e383157be6b857aabc198fe20949fcb1a9b70 (diff)
downloadllvm-8300272823108eb17f01af51c4d54ef5018a5e6d.zip
llvm-8300272823108eb17f01af51c4d54ef5018a5e6d.tar.gz
llvm-8300272823108eb17f01af51c4d54ef5018a5e6d.tar.bz2
AMDGPU: Fix getIntegerAttribute type and error message
llvm-svn: 269268
Diffstat (limited to 'llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
index 52f7648..c6f9142 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
@@ -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;
}