diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2018-09-10 02:23:30 +0000 |
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2018-09-10 02:23:30 +0000 |
| commit | b998674610c6b7c975ff095e91351c64d1619164 (patch) | |
| tree | 1a133442bffb9bc0efc54d0859f5983786ef98aa /llvm/lib | |
| parent | bc38e63718b62393737da8660b33aaaae7067479 (diff) | |
| download | bcm5719-llvm-b998674610c6b7c975ff095e91351c64d1619164.tar.gz bcm5719-llvm-b998674610c6b7c975ff095e91351c64d1619164.zip | |
AMDGPU: Don't abort on unknown addrspace argument
llvm-svn: 341767
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp b/llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp index 6657c08e7e6..fadc833e014 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp @@ -76,20 +76,22 @@ AccessQualifier MetadataStreamer::getAccessQualifier(StringRef AccQual) const { AddressSpaceQualifier MetadataStreamer::getAddressSpaceQualifer( unsigned AddressSpace) const { - if (AddressSpace == AMDGPUAS::PRIVATE_ADDRESS) + switch (AddressSpace) { + case AMDGPUAS::PRIVATE_ADDRESS: return AddressSpaceQualifier::Private; - if (AddressSpace == AMDGPUAS::GLOBAL_ADDRESS) + case AMDGPUAS::GLOBAL_ADDRESS: return AddressSpaceQualifier::Global; - if (AddressSpace == AMDGPUAS::CONSTANT_ADDRESS) + case AMDGPUAS::CONSTANT_ADDRESS: return AddressSpaceQualifier::Constant; - if (AddressSpace == AMDGPUAS::LOCAL_ADDRESS) + case AMDGPUAS::LOCAL_ADDRESS: return AddressSpaceQualifier::Local; - if (AddressSpace == AMDGPUAS::FLAT_ADDRESS) + case AMDGPUAS::FLAT_ADDRESS: return AddressSpaceQualifier::Generic; - if (AddressSpace == AMDGPUAS::REGION_ADDRESS) + case AMDGPUAS::REGION_ADDRESS: return AddressSpaceQualifier::Region; - - llvm_unreachable("Unknown address space qualifier"); + default: + return AddressSpaceQualifier::Unknown; + } } ValueKind MetadataStreamer::getValueKind(Type *Ty, StringRef TypeQual, |

