r324682 - Add size to constexpr Arrays

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 8 15:49:40 PST 2018


Author: erichkeane
Date: Thu Feb  8 15:49:40 2018
New Revision: 324682

URL: http://llvm.org/viewvc/llvm-project?rev=324682&view=rev
Log:
Add size to constexpr Arrays

What seems to be a bug in older versions of MSVC, constexpr
member arrays with a redefinition (to force emission) require
their initial definition to have the size between the brackets.

Modified:
    cfe/trunk/lib/Basic/Targets/AMDGPU.h

Modified: cfe/trunk/lib/Basic/Targets/AMDGPU.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/AMDGPU.h?rev=324682&r1=324681&r2=324682&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets/AMDGPU.h (original)
+++ cfe/trunk/lib/Basic/Targets/AMDGPU.h Thu Feb  8 15:49:40 2018
@@ -69,7 +69,7 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTarg
     AMDGPUTargetInfo::GPUKind Kind;
   };
 
-  static constexpr NameGPUKind R600Names[] = {
+  static constexpr NameGPUKind R600Names[25] = {
       {{"r600"}, GK_R600},
       {{"rv610"}, GK_R600},
       {{"rv620"}, GK_R600},
@@ -96,7 +96,7 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTarg
       {{"cayman"}, GK_CAYMAN},
       {{"aruba"}, GK_CAYMAN},
   };
-  static constexpr NameGPUKind AMDGCNNames[] = {
+  static constexpr NameGPUKind AMDGCNNames[33] = {
       {{"gfx600"}, GK_GFX6},    {{"tahiti"}, GK_GFX6},
       {{"gfx601"}, GK_GFX6},    {{"pitcairn"}, GK_GFX6},
       {{"verde"}, GK_GFX6},     {{"oland"}, GK_GFX6},




More information about the cfe-commits mailing list