)]}' { "commit": "ab7472e733a4081d672e2ef9a8e2011d941d1347", "tree": "f4b82ea7bd48206e365b8a42bff13a7eb6b4067a", "parents": [ "b9d76a314c1e4c79217df9cd9d168d007e90a51c" ], "author": { "name": "Akira Hatanaka", "email": "ahatanaka@apple.com", "time": "Fri Sep 22 21:32:06 2017 +0000" }, "committer": { "name": "Akira Hatanaka", "email": "ahatanaka@apple.com", "time": "Thu Sep 28 10:36:18 2017 -0700" }, "message": "[CodeGen][ObjC] Build the global block structure before emitting the\nbody of global block invoke functions.\n\nThis commit fixes an infinite loop in IRGen that occurs when compiling\nthe following code:\n\nvoid FUNC2() {\n static void (^const block1)(int) \u003d ^(int a){\n if (a--)\n block1(a);\n };\n}\n\nThis is how IRGen gets stuck in the infinite loop:\n\n1. GenerateBlockFunction is called to emit the body of \"block1\".\n\n2. GetAddrOfGlobalBlock is called to get the address of \"block1\". The\n function calls getAddrOfGlobalBlockIfEmitted to check whether the\n global block has been emitted. If it hasn\u0027t been emitted, it then\n tries to emit the body of the block function by calling\n GenerateBlockFunction, which goes back to step 1.\n\nThis commit prevents the inifinite loop by building the global block in\nGenerateBlockFunction before emitting the body of the block function.\n\nrdar://problem/34541684\n\nDifferential Revision: https://reviews.llvm.org/D38118\n\ngit-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314029 91177308-0d34-0410-b5e6-96231b3b80d8\n(cherry picked from commit a3394c6dfe197d84e74eae9cc8b77dc4356cff54)\n", "tree_diff": [ { "type": "modify", "old_id": "372d23c0b200e6a8cc8f3e6d30692c31bb1c54c1", "old_mode": 33188, "old_path": "lib/CodeGen/CGBlocks.cpp", "new_id": "ffc2b08a41cb040115640ee09b0d50f9612e6ffc", "new_mode": 33188, "new_path": "lib/CodeGen/CGBlocks.cpp" }, { "type": "modify", "old_id": "6df54f00a2fa5d5444c6e01fb4ea385ae83216af", "old_mode": 33188, "old_path": "lib/CodeGen/CodeGenFunction.h", "new_id": "4f7c0fa15e06dad1ee4573431baf5dc51de4c6a1", "new_mode": 33188, "new_path": "lib/CodeGen/CodeGenFunction.h" }, { "type": "modify", "old_id": "e8de92d8b400635500fbb7b24171f47ade5022ae", "old_mode": 33188, "old_path": "test/CodeGen/mangle-blocks.c", "new_id": "4ea5a550c8bd935e8c9130f817fa99cbf11b3dad", "new_mode": 33188, "new_path": "test/CodeGen/mangle-blocks.c" }, { "type": "modify", "old_id": "73c670f5c925935beeefbc13f1b81ed9fe2bfc62", "old_mode": 33188, "old_path": "test/CodeGenObjC/local-static-block.m", "new_id": "67ede63fc0a29a4be412a933cad49767b6980744", "new_mode": 33188, "new_path": "test/CodeGenObjC/local-static-block.m" }, { "type": "modify", "old_id": "4cc3204033229cda53b3b57997f8e80f8fc77d3e", "old_mode": 33188, "old_path": "test/CodeGenObjC/mangle-blocks.m", "new_id": "73522cd41c638c30f76812436124b64a27fff0d2", "new_mode": 33188, "new_path": "test/CodeGenObjC/mangle-blocks.m" } ] }