diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp index a0dcd36ac45d56..6986a6d6793430 100644 --- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp +++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp @@ -1012,7 +1012,7 @@ struct AAPointerInfoImpl const DominatorTree *DT = InfoCache.getAnalysisResultForFunction(Scope); - enum GPUAddressSpace : unsigned { + enum class GPUAddressSpace : unsigned { Generic = 0, Global = 1, Shared = 3, @@ -1027,7 +1027,7 @@ struct AAPointerInfoImpl Triple T(M.getTargetTriple()); if (!(T.isAMDGPU() || T.isNVPTX())) return false; - switch (V->getType()->getPointerAddressSpace()) { + switch (GPUAddressSpace(V->getType()->getPointerAddressSpace())) { case GPUAddressSpace::Shared: case GPUAddressSpace::Constant: case GPUAddressSpace::Local: