aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.cpp
diff options
context:
space:
mode:
authorBalazs Benics <balazs.benics@sigmatechnology.se>2021-09-30 11:53:08 +0200
committerBalazs Benics <balazs.benics@sigmatechnology.se>2021-09-30 11:53:08 +0200
commite5e0e00831ba093639edbd443b6e05b3118f8930 (patch)
tree8d36fcaf874aa43366dafa970ddcedcd8a3a44a8 /lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.cpp
parent230a6edb49c31e2c96613f5b7deefd4f4faf9a6d (diff)
downloadllvm-e5e0e00831ba093639edbd443b6e05b3118f8930.zip
llvm-e5e0e00831ba093639edbd443b6e05b3118f8930.tar.gz
llvm-e5e0e00831ba093639edbd443b6e05b3118f8930.tar.bz2
[NFC] Cleanup the overload of ASTImporter::import()
This patch aims to address the comment of a previous review: https://reviews.llvm.org/D109237#inline-1040678 The original problem was the following: `T` is substituted by `clang::Type` Expected<T *> import(T *From) { auto ToOrErr = Importer.Import(From); // ^^^^^^^^^^^^^^^^^^^^^ if (!ToOrErr) return ToOrErr.takeError(); return cast_or_null<T>(*ToOrErr); // ^^^^^^^^^^^^^^^^^^^^^^^^^ } `Importer.Import()` operates on `const Type *`, thus returns `const Type *`. Later, at the return statement, we will try to construct an `Expected<Type*>` from a `const Type *`, which failed with a miserable error message. In all other cases `importer.Import()` results in a non-const version, so everything works out just fine, but for `clang::type`s, we should really return a const version. So, in case of `T` is a subclass of `clang::Type`, it will return a `Exprected<const T*>` instead. Reviewed By: martong Differential Revision: https://reviews.llvm.org/D109269
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.cpp')
0 files changed, 0 insertions, 0 deletions