aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/TestModuleFileExtension.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2021-03-04 22:30:38 -0800
committerCraig Topper <craig.topper@sifive.com>2021-03-04 22:48:25 -0800
commit74e6030bcbcc8e628f9a99a424342a0c656456f9 (patch)
tree501b34d48ea9aa9b273a353b966e21144b7781d7 /clang/lib/Frontend/TestModuleFileExtension.cpp
parent931a3aa96726ec6d2052e24e9966fe32d98ddd3e (diff)
downloadllvm-74e6030bcbcc8e628f9a99a424342a0c656456f9.zip
llvm-74e6030bcbcc8e628f9a99a424342a0c656456f9.tar.gz
llvm-74e6030bcbcc8e628f9a99a424342a0c656456f9.tar.bz2
[TargetLowering] Use HandleSDNodes to prevent nodes from being deleted by recursive calls in getNegatedExpression.
For binary or ternary ops we call getNegatedExpression multiple times and then compare costs. While we're doing this we need to hold a node from the first call across the second call, but its not yet attached to the DAG. Its possible the second call creates an identical node and then decides it didn't need it so will try to delete it if it has no uses. This can cause a reference to the node we're holding further up the call stack to become invalidated. To prevent this, we can use a HandleSDNode to artifically give the node a use without connecting it to the DAG. I've used a std::list of HandleSDNodes so we can create handles only when we have a node to hold. HandleSDNode does not have default constructor and cannot be copied or moved. Fixes PR49393. Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D97914
Diffstat (limited to 'clang/lib/Frontend/TestModuleFileExtension.cpp')
0 files changed, 0 insertions, 0 deletions