[PATCH] D55439: [MC] Do not consider .ifdef/.ifndef as a use
Scott Linder via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 28 11:33:05 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL352414: [MC] Do not consider .ifdef/.ifndef as a use (authored by scott.linder, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D55439?vs=182307&id=183922#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55439/new/
https://reviews.llvm.org/D55439
Files:
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/test/MC/AsmParser/ifdef.s
llvm/trunk/test/MC/AsmParser/ifndef.s
Index: llvm/trunk/test/MC/AsmParser/ifdef.s
===================================================================
--- llvm/trunk/test/MC/AsmParser/ifdef.s
+++ llvm/trunk/test/MC/AsmParser/ifdef.s
@@ -27,3 +27,17 @@
.else
.byte 1
.endif
+
+# .ifdef directive does not count as a use, so ensure redefinition is permitted
+.set var, 1
+.ifdef var
+ .set var, 2
+.else
+ .set var, 3
+.endif
+# CHECK: .byte 2
+.byte var
+
+.set var, 4
+# CHECK: .byte 4
+.byte var
Index: llvm/trunk/test/MC/AsmParser/ifndef.s
===================================================================
--- llvm/trunk/test/MC/AsmParser/ifndef.s
+++ llvm/trunk/test/MC/AsmParser/ifndef.s
@@ -27,3 +27,17 @@
.else
.byte 0
.endif
+
+# .ifndef directive does not count as a use, so ensure redefinition is permitted
+.set var, 1
+.ifndef var
+ .set var, 2
+.else
+ .set var, 3
+.endif
+# CHECK: .byte 3
+.byte var
+
+.set var, 4
+# CHECK: .byte 4
+.byte var
Index: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
===================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp
@@ -5038,9 +5038,9 @@
MCSymbol *Sym = getContext().lookupSymbol(Name);
if (expect_defined)
- TheCondState.CondMet = (Sym && !Sym->isUndefined());
+ TheCondState.CondMet = (Sym && !Sym->isUndefined(false));
else
- TheCondState.CondMet = (!Sym || Sym->isUndefined());
+ TheCondState.CondMet = (!Sym || Sym->isUndefined(false));
TheCondState.Ignore = !TheCondState.CondMet;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55439.183922.patch
Type: text/x-patch
Size: 1555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190128/e35e14da/attachment.bin>
More information about the llvm-commits
mailing list