aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-11-10 18:05:57 +0000
committerChris Lattner <sabre@nondot.org>2005-11-10 18:05:57 +0000
commit38b6d78112d975d288615db2913418c8bd1b0956 (patch)
tree4d40acad38cbe9fa6c172e2c3ec4265358144221 /include/llvm
parent99b8e26b84033b5932cfe2a1d1542ea33cb21a8a (diff)
downloadexternal_llvm-38b6d78112d975d288615db2913418c8bd1b0956.zip
external_llvm-38b6d78112d975d288615db2913418c8bd1b0956.tar.gz
external_llvm-38b6d78112d975d288615db2913418c8bd1b0956.tar.bz2
add support for .asciz, and enable it by default. If your target assembler
doesn't support .asciz, just set AscizDirective to null in your asmprinter. This compiles C strings to: l1__2E_str_1: ; '.str_1' .asciz "foo" instead of: l1__2E_str_1: ; '.str_1' .ascii "foo\000" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24271 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/CodeGen/AsmPrinter.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h
index f28c00f..e6b7fcc 100644
--- a/include/llvm/CodeGen/AsmPrinter.h
+++ b/include/llvm/CodeGen/AsmPrinter.h
@@ -77,7 +77,12 @@ namespace llvm {
/// AsciiDirective - This directive allows emission of an ascii string with
/// the standard C escape characters embedded into it.
- const char *AsciiDirective;
+ const char *AsciiDirective; // Defaults to "\t.ascii\t"
+
+ /// AscizDirective - If not null, this allows for special handling of
+ /// zero terminated strings on this target. This is commonly supported as
+ /// ".asciz". If a target doesn't support this, it can be set to null.
+ const char *AscizDirective; // Defaults to "\t.asciz\t"
/// DataDirectives - These directives are used to output some unit of
/// integer data to the current section. If a data directive is set to
@@ -108,6 +113,7 @@ namespace llvm {
FunctionAddrSuffix(""),
ZeroDirective("\t.zero\t"),
AsciiDirective("\t.ascii\t"),
+ AscizDirective("\t.asciz\t"),
Data8bitsDirective("\t.byte\t"),
Data16bitsDirective("\t.short\t"),
Data32bitsDirective("\t.long\t"),