[PATCH] D53059: [NFC] Fix the regular expression for BE PPC in update_llc_test_checks.py

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 10 12:32:28 PDT 2018


MaskRay added inline comments.


================
Comment at: utils/UpdateTestChecks/asm.py:53
 
+ASM_FUNCTION_PPC_BE_RE = re.compile(
+    r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n'
----------------
nemanjai wrote:
> MaskRay wrote:
> > Can this be merged with `ASM_FUNCTION_PPC_RE`? If not, is it possible to extract the common part to a variable `ASM_FUNCTION_PPC_COMMON` (you make give it a better name)?
> To be honest with you, this regular expression syntax is mostly gibberish to me. From what I was able to decipher, the first line looks for `function_name:  # @function_name` which appears in PPC asm syntax. Then for LE, the following line is `.Lfunc_beginN:` whereas for BE, there are a few more lines with `.p2align`, `.quad`, `.text`.
> Perhaps it is possible to match both with something like `.*?`
> i.e. match anything non-greedy until you encounter what's in the next RE. And the next thing will be the `.Lfunc_beginN:`
Yeah if .p2align .quad .text are not that important, maybe a catch-all `.*` is better..


Repository:
  rL LLVM

https://reviews.llvm.org/D53059





More information about the llvm-commits mailing list