================
@@ -28,6 +29,12 @@ class ExceptionAnalyzer {
                  ///< definition.
   };
 
+  /// We use a SetVector to preserve the order of the functions in the call
+  /// stack as well as have fast lookup.
+  using CallStack = llvm::SetVector<const FunctionDecl *,
+                                    llvm::SmallVector<const FunctionDecl *, 
32>,
+                                    llvm::DenseSet<const FunctionDecl *>, 32>;
----------------
vbvictor wrote:

I can see a possible solution when we change `throwsException` method signature 
to 
```cpp
throwsException(const FunctionDecl *Func,
                const ExceptionInfo::Throwables &Caught,
                CallStack &CallStack,
                SourceLocation CalledLoc); // new parameter to track from where 
'Func' was called
```
and later `CalledLoc` should be saved in `CallStack`
```cpp
if (const Stmt *Body = Func->getBody()) {
    CallStack.insert({Func, CalledLoc}); // saved in llvm::MapVector<>
    ExceptionInfo Result = throwsException(Body, Caught, CallStack);
```
I will try to implement this new logic and fall back to initial implementation 
if something goes wrong.

https://github.com/llvm/llvm-project/pull/134375
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to