diff options
author | JF Bastien <jfb@google.com> | 2016-01-07 23:18:29 +0000 |
---|---|---|
committer | JF Bastien <jfb@google.com> | 2016-01-07 23:18:29 +0000 |
commit | b9ec4c6cea629ecf177d9d56640e1b87bdd8befc (patch) | |
tree | e678ef21abed0d2fe5eb238c93b4b5915afeb479 /llvm/lib | |
parent | c5b779cb925487fce0d586a44955be8f1524e3af (diff) | |
download | bcm5719-llvm-b9ec4c6cea629ecf177d9d56640e1b87bdd8befc.tar.gz bcm5719-llvm-b9ec4c6cea629ecf177d9d56640e1b87bdd8befc.zip |
WebAssembly: use .skip instead of .zero directive
.zero is confusing when used with two arguments. Documentation:
This directive emits SIZE 0-valued bytes. SIZE must be an absolute
expression. This directive is actually an alias for the '.skip'
directive so in can take an optional second argument of the value to
store in the bytes instead of zero. Using '.zero' in this way would be
confusing however.
Ref: https://sourceware.org/bugzilla/show_bug.cgi?id=18353
Hexagon and Sparc do the same, and it's all the same to WebAssembly so
let's pick the less confusing of the two.
llvm-svn: 257111
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp index b1ab3ef29d8..02c717a9210 100644 --- a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp +++ b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp @@ -29,6 +29,10 @@ WebAssemblyMCAsmInfo::WebAssemblyMCAsmInfo(const Triple &T) { UseDataRegionDirectives = true; + // Use .skip instead of .zero because .zero is confusing when used with two + // arguments (it doesn't actually zero things out). + ZeroDirective = "\t.skip\t"; + Data8bitsDirective = "\t.int8\t"; Data16bitsDirective = "\t.int16\t"; Data32bitsDirective = "\t.int32\t"; |