diff options
author | Alejandro Álvarez Ayllón <alejandro.alvarez@sonarsource.com> | 2024-10-11 15:23:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-11 09:23:47 -0400 |
commit | bd12729a828c653da53f7182dda29982123913db (patch) | |
tree | d3076e47880a52c918667b8982aef46fdb558f36 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | c3a10dc8498b1e501f5a32b082b63b0c1fc499a5 (diff) | |
download | llvm-bd12729a828c653da53f7182dda29982123913db.zip llvm-bd12729a828c653da53f7182dda29982123913db.tar.gz llvm-bd12729a828c653da53f7182dda29982123913db.tar.bz2 |
[clang] Ignore inline namespace for `hasName` (#109147)
Add a new enumeration `SuppressInlineNamespaceMode` to `PrintingPolicy` that
is explicit about how to handle inline namespaces. `SuppressInlineNamespace`
uses that enumeration now instead of a Boolean value.
Specializing a template from an inline namespace should be transparent.
For instance
```
namespace foo {
inline namespace v1 {
template<typename A>
void function(A&);
}
}
namespace foo {
template<>
void function<int>(int&);
}
```
`hasName` should match both declarations of `foo::function`.
Makes the behavior of `matchesNodeFullSlow` and `matchesNodeFullFast`
consistent, fixing an assert inside `HasNameMatcher::matchesNode`.
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 609957b..06015a9 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -287,7 +287,8 @@ PrintingPolicy CGDebugInfo::getPrintingPolicy() const { PP.SplitTemplateClosers = true; } - PP.SuppressInlineNamespace = false; + PP.SuppressInlineNamespace = + PrintingPolicy::SuppressInlineNamespaceMode::None; PP.PrintCanonicalTypes = true; PP.UsePreferredNames = false; PP.AlwaysIncludeTypeForTemplateArgument = true; |