diff options
| author | Erich Keane <erich.keane@intel.com> | 2019-09-17 14:11:51 +0000 |
|---|---|---|
| committer | Erich Keane <erich.keane@intel.com> | 2019-09-17 14:11:51 +0000 |
| commit | 68b0977e646abda3254a1eed123f75183b4aad3d (patch) | |
| tree | d0f43c455b1c9565e4f69ed8010f2265ce2a9148 /clang/lib | |
| parent | 84a2f5e8b7874e111c7212008ec2fb6372a4a2c7 (diff) | |
| download | bcm5719-llvm-68b0977e646abda3254a1eed123f75183b4aad3d.tar.gz bcm5719-llvm-68b0977e646abda3254a1eed123f75183b4aad3d.zip | |
Add SpellingNotCalculated to Attribute Enums to suppress UBSan warnings
UBSan downstreams noticed that the assignment of SpellingNotCalculated
to the spellings caused warnings.
llvm-svn: 372124
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/MicrosoftMangle.cpp | 4 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaType.cpp | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index 7ad8b52f7fd..efa7f43cb45 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -615,6 +615,8 @@ void MicrosoftCXXNameMangler::mangleMemberDataPointer(const CXXRecordDecl *RD, case MSInheritanceAttr::Keyword_multiple_inheritance: Code = '0'; break; case MSInheritanceAttr::Keyword_virtual_inheritance: Code = 'F'; break; case MSInheritanceAttr::Keyword_unspecified_inheritance: Code = 'G'; break; + case MSInheritanceAttr::SpellingNotCalculated: + llvm_unreachable("not reachable"); } Out << '$' << Code; @@ -646,6 +648,8 @@ MicrosoftCXXNameMangler::mangleMemberFunctionPointer(const CXXRecordDecl *RD, case MSInheritanceAttr::Keyword_multiple_inheritance: Code = 'H'; break; case MSInheritanceAttr::Keyword_virtual_inheritance: Code = 'I'; break; case MSInheritanceAttr::Keyword_unspecified_inheritance: Code = 'J'; break; + case MSInheritanceAttr::SpellingNotCalculated: + llvm_unreachable("not reachable"); } // If non-virtual, mangle the name. If virtual, mangle as a virtual memptr diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index e36f6932f86..e656fe6b8b9 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -2711,6 +2711,8 @@ llvm::DIType *CGDebugInfo::CreateType(const MemberPointerType *Ty, break; case MSInheritanceAttr::Keyword_unspecified_inheritance: break; + case MSInheritanceAttr::SpellingNotCalculated: + llvm_unreachable("Spelling not yet calculated"); } } } diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index 019ac5ea886..c892c62a026 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -1633,6 +1633,8 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) { case OpenCLAccessAttr::Keyword_read_only: \ Result = Context.Id##ROTy; \ break; \ + case OpenCLAccessAttr::SpellingNotCalculated: \ + llvm_unreachable("Spelling not yet calculated"); \ } \ break; #include "clang/Basic/OpenCLImageTypes.def" |

