[FunctionAttrs] Don't copy all the nodes where a reference is fine.
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 14 Apr 2020 14:52:26 +0000 (16:52 +0200)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 14 Apr 2020 15:18:23 +0000 (17:18 +0200)
llvm/lib/Transforms/IPO/FunctionAttrs.cpp

index b6d0b2e..6b11075 100644 (file)
@@ -1306,7 +1306,7 @@ static bool inferAttrsFromFunctionBodies(const SCCNodeSet &SCCNodes) {
         // Skip non-throwing functions.
         [](const Function &F) { return F.doesNotThrow(); },
         // Instructions that break non-throwing assumption.
-        [SCCNodes](Instruction &I) {
+        [&SCCNodes](Instruction &I) {
           return InstrBreaksNonThrowing(I, SCCNodes);
         },
         [](Function &F) {
@@ -1329,7 +1329,7 @@ static bool inferAttrsFromFunctionBodies(const SCCNodeSet &SCCNodes) {
         // Skip functions known not to free memory.
         [](const Function &F) { return F.doesNotFreeMemory(); },
         // Instructions that break non-deallocating assumption.
-        [SCCNodes](Instruction &I) {
+        [&SCCNodes](Instruction &I) {
           return InstrBreaksNoFree(I, SCCNodes);
         },
         [](Function &F) {