brintos

brintos / llvm-project-archived public Read only

0
0
Text · 674 B · ce7d9b1 Raw
27 lines · python
1#!/usr/bin/env python32 3"""4 Add attributes hook in an HLFIR code to test fir.call ModRef effects5 with the test-fir-alias-analysis-modref pass.6 7 This will insert mod ref test hook:8   - to any fir.call to a function which name starts with "test_effect_"9   - to any hlfir.declare for variable which name starts with "test_var_"10"""11 12import sys13import re14 15for line in sys.stdin:16    line = re.sub(17        r"(fir.call @_\w*P)(test_effect_\w*)(\(.*) : ",18        r'\1\2\3 {test.ptr ="\2"} : ',19        line,20    )21    line = re.sub(22        r'(hlfir.declare .*uniq_name =.*E)(test_var_\w*)"',23        r'\1\2", test.ptr ="\2"',24        line,25    )26    sys.stdout.write(line)27