================
@@ -315,6 +315,62 @@ static bool isFunctionMacroExpansion(SourceLocation Loc,
return EInfo.isFunctionMacroExpansion();
}
+static const LocationContext *getFirstNonCtorCall(const LocationContext *LCtx)
{
+ while (llvm::isa_and_nonnull<CXXConstructorDecl>(LCtx->getDecl()))
+ LCtx = LCtx->getParent();
+ return LCtx;
+}
+
+static const MemRegion *getInitializerRegion(const PostInitializer &PI) {
+ return reinterpret_cast<const MemRegion *>(PI.getLocationValue());
----------------
NagyDonat wrote:
This reinterpret cast is really scary, but I see that this is apparently the
intended way of using `PostInitializer` objects (which is a bit crazy). Perhaps
add an explanation comment.
It would be good to have a templated `PostInitializer::getLocationValue<T>()
const` which returns `const T *` instead of `const void *`. However, that class
is defined outside of CSA so I'm not sure that this is worth the effort.
https://github.com/llvm/llvm-project/pull/106982
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits