Add comments explaining the diff from cf8e3f8757

These comments should make it easier to see the (small) diff introduced
in cf8e3f8757. Without these comments, the diff may get list on a future
upstream merge.
This commit is contained in:
Josh Kunz 2019-08-12 13:28:09 -07:00 committed by Fangrui Song
parent ad41eacfb7
commit 6733782381
2 changed files with 14 additions and 0 deletions

View File

@ -49,6 +49,13 @@ NF > 1 {
if (test)
print " TEST (" name ", \"" FILENAME ":" FNR "\", " $0 ")";
else
# The `.ascii` directive here is needed for LLVM/clang support. LLVM will
# validate every `asm(...)` directive before emitting it, whereas GCC will
# literally emit the directive without validation. Without `.ascii` the
# directives emitted by this generator are not valid assembler statements,
# and the LLVM assembler will fail to assemble the file. The `.ascii` here
# has no functional affect, because string parsing is used to extract the
# integer constant from the assembly file built from the generated file.
printf "asm (\".ascii \\\"@@@name@@@%s@@@value@@@%%0@@@end@@@\\\"\" : : \"i\" ((long) %s));\n",
name, $0;
}

View File

@ -109,6 +109,13 @@ NF > 1 {
# Remove any characters before the second field.
sub(/^[^[:blank:]]+[[:blank:]]+/, "");
# The `.ascii` directive here is needed for LLVM/clang support. LLVM will
# validate every `asm(...)` directive before emitting it, whereas GCC will
# literally emit the directive without validation. Without `.ascii` the
# directives emitted by this generator are not valid assembler statements,
# and the LLVM assembler will fail to assemble the file. The `.ascii` here
# has no functional affect, because string parsing is used to extract the
# integer constant from the assembly file built from the generated file.
# '$0' ends up being everything that appeared after the first field
# separator.
printf " asm (\".ascii \\\"@name@%s@value@%0@\\\"\" : : \"i\" (%s));\n", name, $0;