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")