[PATCH] D72375: Disallow an empty string literal in an asm label

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 7 16:09:40 PST 2020


aaron.ballman created this revision.
aaron.ballman added reviewers: rjmccall, joerg, eli.friedman.

An empty string literal in an asm label does not make a whole lot of sense. GCC does not diagnose such a construct, but it also generates code that cannot be assembled by gas should two symbols have an empty asm label within the same TU. This does not affect an asm statement with an empty string literal, which is still a useful construct.

The default parameter was converted to a mandated parameter in `ParseSimpleAsm()` because all callers passed the argument anyway. The test code in CodeGen\asm-label.c was removed because it was no longer needed to satisfy the PR (it's covered by test code in Parser\asm.c).


https://reviews.llvm.org/D72375

Files:
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/include/clang/Parse/Parser.h
  clang/lib/Parse/ParseDecl.cpp
  clang/lib/Parse/ParseDeclCXX.cpp
  clang/lib/Parse/ParseExprCXX.cpp
  clang/lib/Parse/ParseStmtAsm.cpp
  clang/lib/Parse/Parser.cpp
  clang/test/AST/ast-print-attr.c
  clang/test/CodeGen/asm-label.c
  clang/test/Parser/asm.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72375.236712.patch
Type: text/x-patch
Size: 7894 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200108/0294a5b9/attachment-0001.bin>


More information about the cfe-commits mailing list