aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2024-09-02 08:34:14 +0200
committerGitHub <noreply@github.com>2024-09-02 08:34:14 +0200
commitdd5d73007240712957f2b633f795d9965afaadd6 (patch)
tree53381ed8b6ff420fa58072bf60edea03f415c442 /llvm/lib/Support/APInt.cpp
parentda13754103b8880811f4c164d858c6dd3c393927 (diff)
downloadllvm-dd5d73007240712957f2b633f795d9965afaadd6.zip
llvm-dd5d73007240712957f2b633f795d9965afaadd6.tar.gz
llvm-dd5d73007240712957f2b633f795d9965afaadd6.tar.bz2
[lldb] Better matching of types in anonymous namespaces (#102111)
This patch extends TypeQuery matching to support anonymous namespaces. A new flag is added to control the behavior. In the "strict" mode, the query must match the type exactly -- all anonymous namespaces included. The dynamic type resolver in the itanium abi (the motivating use case for this) uses this flag, as it queries using the name from the demangles, which includes anonymous namespaces. This ensures we don't confuse a type with a same-named type in an anonymous namespace. However, this does *not* ensure we don't confuse two types in anonymous namespacs (in different CUs). To resolve this, we would need to use a completely different lookup algorithm, which probably also requires a DWARF extension. In the "lax" mode (the default), the anonymous namespaces in the query are optional, and this allows one search for the type using the usual language rules (`::A` matches `::(anonymous namespace)::A`). This patch also changes the type context computation algorithm in DWARFDIE, so that it includes anonymous namespace information. This causes a slight change in behavior: the algorithm previously stopped computing the context after encountering an anonymous namespace, which caused the outer namespaces to be ignored. This meant that a type like `NS::(anonymous namespace)::A` would be (incorrectly) recognized as `::A`). This can cause code depending on the old behavior to misbehave. The fix is to specify all the enclosing namespaces in the query, or use a non-exact match.
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
0 files changed, 0 insertions, 0 deletions