commit | d5ec2a1321106a4bc56cba197dfbc538c09b4ae9 | [log] [tgz] |
---|---|---|
author | Pirama Arumuga Nainar <pirama@google.com> | Thu Aug 08 15:37:06 2019 -0700 |
committer | Pirama Arumuga Nainar <pirama@google.com> | Fri Aug 09 15:45:21 2019 +0000 |
tree | 158310581c8343c5d8840b2b6febbb17bde01ad2 | |
parent | fa595885339140c3507f26d93cdc6b99081e23c5 [diff] |
Make the $/# in front of constants optional Bug: http://b/117842681 Bug: https://github.com/android-ndk/ndk/issues/1036 After change https://reviews.llvm.org/D65550, Clang stopped emitting '#' before constants in inline assembly. To accommodate this change, mark the $/# before constants as optional in make_header.py Test: Build with old and new compilers Change-Id: Idb056c99a2bfc4d14e4e30d7dc1d0740ca4f9b60
diff --git a/tools/cpp-define-generator/make_header.py b/tools/cpp-define-generator/make_header.py index 1b13923..f3657b1 100755 --- a/tools/cpp-define-generator/make_header.py +++ b/tools/cpp-define-generator/make_header.py
@@ -31,7 +31,7 @@ def convert(input): """Find all defines in the compiler generated assembly and convert them to #define pragmas""" - asm_define_re = re.compile(r'">>(\w+) (?:\$|#)([-0-9]+) (?:\$|#)(0|1)<<"') + asm_define_re = re.compile(r'">>(\w+) (?:\$|#)?([-0-9]+) (?:\$|#)?(0|1)<<"') asm_defines = asm_define_re.findall(input) if not asm_defines: raise RuntimeError("Failed to find any asm defines in the input")