Commit fe01aee
15/n ifdef: Fix MacroExpCtx to search past includes
Summary:
- Fix `find_define` and `find_defines_by_name` in `MacroExpCtx` to continue searching past `#include` directives instead of stopping
- Previously, `find_define` returned `None` and `find_defines_by_name` broke out of the loop when encountering an include, causing macros defined before an include to be missed
- Add tests verifying that defines are found across include boundaries
Reviewed By: TD5
Differential Revision: D94369223
fbshipit-source-id: c48b5d110e606eccf7089d7e60da5ba7efba9b7e1 parent 46b4ade commit fe01aee
1 file changed
+33
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
316 | | - | |
| 315 | + | |
317 | 316 | | |
318 | 317 | | |
319 | 318 | | |
| |||
342 | 341 | | |
343 | 342 | | |
344 | 343 | | |
345 | | - | |
346 | | - | |
| 344 | + | |
347 | 345 | | |
348 | 346 | | |
349 | 347 | | |
| |||
721 | 719 | | |
722 | 720 | | |
723 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
724 | 753 | | |
725 | 754 | | |
726 | 755 | | |
| |||
0 commit comments