diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-11-05 10:10:50 -0500 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-11-05 10:31:59 -0500 |
commit | 7b710a4294c1baed0157d86d3e2dabac78c306ce (patch) | |
tree | 55375fd3f16981656b9ad1c0377d5c8f80d572ba /clang/lib/CodeGen | |
parent | 100e797adb433724a17c9b42b6533cd634cb796b (diff) | |
download | bcm5719-llvm-7b710a4294c1baed0157d86d3e2dabac78c306ce.tar.gz bcm5719-llvm-7b710a4294c1baed0157d86d3e2dabac78c306ce.zip |
[OPENMP]Improve diagnostics for unsupported unified addressing.
Improved diagnostics for better user experience.
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp index eab2d7be1ae..96716c0edd9 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp @@ -4954,7 +4954,8 @@ void CGOpenMPRuntimeNVPTX::checkArchForUnifiedAddressing( const OMPRequiresDecl *D) { for (const OMPClause *Clause : D->clauselists()) { if (Clause->getClauseKind() == OMPC_unified_shared_memory) { - switch (getCudaArch(CGM)) { + CudaArch Arch = getCudaArch(CGM); + switch (Arch) { case CudaArch::SM_20: case CudaArch::SM_21: case CudaArch::SM_30: @@ -4966,10 +4967,14 @@ void CGOpenMPRuntimeNVPTX::checkArchForUnifiedAddressing( case CudaArch::SM_53: case CudaArch::SM_60: case CudaArch::SM_61: - case CudaArch::SM_62: - CGM.Error(Clause->getBeginLoc(), - "Target architecture does not support unified addressing"); + case CudaArch::SM_62: { + SmallString<256> Buffer; + llvm::raw_svector_ostream Out(Buffer); + Out << "Target architecture " << CudaArchToString(Arch) + << " does not support unified addressing"; + CGM.Error(Clause->getBeginLoc(), Out.str()); return; + } case CudaArch::SM_70: case CudaArch::SM_72: case CudaArch::SM_75: |