diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-31 21:22:58 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-31 21:22:58 +0000 |
commit | 5ffd83dbcc34f10e07f6d3e968ae6365869615f4 (patch) | |
tree | 0e9f5cf729dde39f949698fddef45a34e2bc7f44 /contrib/llvm-project/clang/lib/AST/DeclarationName.cpp | |
parent | 1799696096df87b52968b8996d00c91e0a5de8d9 (diff) | |
parent | cfca06d7963fa0909f90483b42a6d7d194d01e08 (diff) |
Notes
Diffstat (limited to 'contrib/llvm-project/clang/lib/AST/DeclarationName.cpp')
-rw-r--r-- | contrib/llvm-project/clang/lib/AST/DeclarationName.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/contrib/llvm-project/clang/lib/AST/DeclarationName.cpp b/contrib/llvm-project/clang/lib/AST/DeclarationName.cpp index 4eb11bc57e52..ecf676c9936d 100644 --- a/contrib/llvm-project/clang/lib/AST/DeclarationName.cpp +++ b/contrib/llvm-project/clang/lib/AST/DeclarationName.cpp @@ -17,6 +17,7 @@ #include "clang/AST/DeclBase.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclTemplate.h" +#include "clang/AST/OpenMPClause.h" #include "clang/AST/PrettyPrinter.h" #include "clang/AST/Type.h" #include "clang/AST/TypeLoc.h" @@ -138,8 +139,19 @@ void DeclarationName::print(raw_ostream &OS, const PrintingPolicy &Policy) const { switch (getNameKind()) { case DeclarationName::Identifier: - if (const IdentifierInfo *II = getAsIdentifierInfo()) - OS << II->getName(); + if (const IdentifierInfo *II = getAsIdentifierInfo()) { + StringRef Name = II->getName(); + // If this is a mangled OpenMP variant name we strip off the mangling for + // printing. It should not be visible to the user at all. + if (II->isMangledOpenMPVariantName()) { + std::pair<StringRef, StringRef> NameContextPair = + Name.split(getOpenMPVariantManglingSeparatorStr()); + OS << NameContextPair.first << "[" + << OMPTraitInfo(NameContextPair.second) << "]"; + } else { + OS << Name; + } + } return; case DeclarationName::ObjCZeroArgSelector: |