[LLVMdev] #define LLVM_ASM_PREFIX_CHAR '\1' to make code more readable?

Timo Juhani Lindfors timo.lindfors at iki.fi
Wed Nov 18 10:17:11 PST 2009


Hi,

llvm, clang and llvm-gcc contain numerous references to 1, '\1',
'\01', '\001', "\01" and "\01foo". This makes it difficult for one to
find all occurences of this prefix character and lacks a central place
where the prefix could be documented. (See for example
http://llvm.org/bugs/show_bug.cgi?id=5480 )

How about adding a #define for this prefix? The attached three patches
contain occurences of this prefix in llvm, clang and llvm-gcc that I
was able to identify but I don't know what would be a proper place for
the #define itself. Also should it maybe be LLVM_ASM_PREFIX or just
ASM_PREFIX? (I think both character and string versions are
needed. Afaik characters can not be concatenated to strings with
the preprocessor).

I am also not quite sure how the prefix should be documented. Does
"\01foo" mean "foo is a name that can be given to assembler or dlsym()
and should not ever be mangled in any way"?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-asm-prefix1.patch
Type: text/x-diff
Size: 5201 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091118/f3c17d58/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-gcc-asm-prefix1.patch
Type: text/x-diff
Size: 2825 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091118/f3c17d58/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-asm-prefix1.patch
Type: text/x-diff
Size: 31109 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091118/f3c17d58/attachment-0002.patch>


More information about the llvm-dev mailing list