getFunctionTypeInternal forms a FoldingSetNodeID and then calls FunctionProtoTypes.FindNodeOrInsertPos(). Later, upon returning from recursion, it calls FunctionProtoTypes.FindNodeOrInsertPos() again with the same ID. This second call will yield the same InsertPos unless the recursion caused FunctionProtoTypes to rebucket. The rebucketing can be detected by comparing the capacity of the set before and after the recursion, which allows us to skip the redundant call.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Nice catch, thanks for improving this.
Any chance you've got any small enough example that trigger this that could be transformed into a testcase? It would be nice to have a unittest for this, see others in clang/unittests/AST.
Nitpick: please capitalize avoid in the title.