LLVM/project f7eec83llvm/include/llvm/MC MCAsmInfo.h, llvm/lib/MC/MCParser AsmLexer.cpp

[AsmParser][SystemZ][z/OS] Add in support to allow use of additional comment strings.

- Currently, MCAsmInfo provides a CommentString attribute, that various targets can set, so that the AsmLexer can appropriately lex a string as a comment based on the set value of the attribute.
- However, AsmLexer also supports a few additional comment syntaxes, in addition to what's specified as a CommentString attribute. This includes regular C-style block comments (/* ... */), regular C-style line comments (// .... ) and #. While I'm not sure as to why this behaviour exists, I am assuming it does to maintain backward compatibility with GNU AS (see https://sourceware.org/binutils/docs/as/Comments.html#Comments for reference)
For example:
Consider a target which sets the CommentString attribute to '*'.
The following strings are all lexed as comments.

```
"# abc" -> comment
"// abc" -> comment
"/* abc */ -> comment
"* abc" -> comment
```

- In HLASM however, only "*" is accepted as a comment string, and nothing else.
- To achieve this, an additional attribute (`AllowAdditionalComments`) has been added to MCAsmInfo. If this attribute is set to false, then only the string specified by the CommentString attribute is used as a possible comment string to be lexed by the AsmLexer. The regular C-style block comments, line comments and "#" are disabled. As a final note, "#" will still be treated as a comment, if the CommentString attribute is set to "#".

Depends on https://reviews.llvm.org/D99277

    [4 lines not shown]
DeltaFile
+154-0llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
+9-1llvm/lib/MC/MCParser/AsmLexer.cpp
+9-0llvm/include/llvm/MC/MCAsmInfo.h
+1-0llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp
+173-14 files

LLVM/project edb18eallvm/lib/MC/MCParser AsmLexer.cpp, llvm/test/MC/AsmParser directive_values.s

[AsmParser] Recognize more escaped characters between single quotes

The GNU AS manual states the following about single-character constants enclosed within single quotes:

>  Some backslash escapes apply to characters, \b, \f, \n, \r, \t, and \" with the same meaning as for strings, plus \' for a single quote.

Add two more characters to the switch handling this case to match GAS behaviour, plus a test to make sure nothing regresses.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D99609
DeltaFile
+33-25llvm/test/MC/AsmParser/directive_values.s
+2-0llvm/lib/MC/MCParser/AsmLexer.cpp
+35-252 files

LLVM/project 4db18d6llvm/include/llvm/MC MCAsmInfo.h, llvm/include/llvm/MC/MCParser MCAsmLexer.h

[M68k] Add support for Motorola literal syntax to AsmParser

These look like $00A0cf for hex and  %001010101 for binary. They are used in Motorola assembly syntax.

Differential Revision: https://reviews.llvm.org/D98519
DeltaFile
+37-1llvm/lib/MC/MCParser/AsmLexer.cpp
+10-0llvm/test/MC/AsmParser/motorola_integers.s
+5-0llvm/tools/llvm-mc/llvm-mc.cpp
+5-0llvm/include/llvm/MC/MCParser/MCAsmLexer.h
+4-0llvm/include/llvm/MC/MCAsmInfo.h
+1-0llvm/lib/Target/M68k/MCTargetDesc/M68kMCAsmInfo.cpp
+62-16 files

LLVM/project 7b921a6llvm/include/llvm/MC/MCParser MCAsmLexer.h, llvm/lib/MC/MCParser AsmLexer.cpp

[AsmParser][SystemZ][z/OS] Add in support to accept "#" as part of an Identifier token

- This patch adds in support to accept the "#" character as part of an Identifier.
- This support is needed especially for the HLASM dialect since "#" is treated as part of the valid "Alphabet" range
- The way this is done is by making use of the previous precedent set by the `AllowAtInIdentifier` field in `MCAsmLexer.h`. A new field called `AllowHashInIdentifier` is introduced.
- The static function `IsIdentifierChar` is also updated to accept the `#` character if the `AllowHashInIdentifier` field is set to true.
Note: The field introduced in `MCAsmLexer.h` could very well be moved to `MCAsmInfo.h`. I'm not opposed to it. I decided to put it in `MCAsmLexer` since there seems to be some sort of precedent already with `AllowAtInIdentifier`.

Reviewed By: abhina.sreeskantharajan, nickdesaulniers, MaskRay

Differential Revision: https://reviews.llvm.org/D99277
DeltaFile
+63-2llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
+10-8llvm/lib/MC/MCParser/AsmLexer.cpp
+3-0llvm/include/llvm/MC/MCParser/MCAsmLexer.h
+76-103 files

LLVM/project 301d926llvm/include/llvm/MC MCAsmInfo.h, llvm/lib/MC/MCParser AsmLexer.cpp

[AsmParser][SystemZ][z/OS] Re-introduce HLASM comment syntax

- https://reviews.llvm.org/rGb605cfb336989705f391d255b7628062d3dfe9c3 was reverted due to sanitizer bugs in the introduced unit-test (specifically in the Address sanitizer https://lab.llvm.org/buildbot/#/builders/5/builds/5697)
- This patch attempts to rectify that, as well as re-factor parts of the test
- The issue was previously, within the `setupCallToAsmParser` function in the unit-test, `SrcMgr` was declared as a local variable. `SrcMgr` owns a unique pointer. Since the variable goes out of scope at the end of the function, the unique pointer is released.
- This patch, moves the declaration of the `SrcMgr` variable to a class field, since the scope will remain until the class's destructor is invoked (which in this case is at the end of the unit test)
- Furthermore, this patch also moves the `MCContext Ctx` declaration from a local variable instance inside a function, to a unique pointer class field. This ensures the instantiation of the MCContext remains until the tear down of the test.

Reviewed By: abhina.sreeskantharajan

Differential Revision: https://reviews.llvm.org/D99004
DeltaFile
+155-0llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
+14-0llvm/unittests/MC/SystemZ/CMakeLists.txt
+8-1llvm/include/llvm/MC/MCAsmInfo.h
+2-1llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp
+3-0llvm/lib/MC/MCParser/AsmLexer.cpp
+182-25 files

LLVM/project 9f5da80llvm/include/llvm/MC MCAsmInfo.h, llvm/lib/MC/MCParser AsmLexer.cpp

Revert "[AsmParser][SystemZ][z/OS] Reland "Introduce HLASM Comment Syntax""

This reverts commit b605cfb336989705f391d255b7628062d3dfe9c3.

Differential Revision: https://reviews.llvm.org/D98744
DeltaFile
+0-163llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
+0-14llvm/unittests/MC/SystemZ/CMakeLists.txt
+1-8llvm/include/llvm/MC/MCAsmInfo.h
+0-3llvm/lib/MC/MCParser/AsmLexer.cpp
+1-2llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp
+2-1905 files

LLVM/project b605cfbllvm/include/llvm/MC MCAsmInfo.h, llvm/lib/MC/MCParser AsmLexer.cpp

[AsmParser][SystemZ][z/OS] Reland "Introduce HLASM Comment Syntax"

- Previously, https://reviews.llvm.org/D97703 was [[ https://reviews.llvm.org/D98543 | reverted ]] as it broke when building the unit tests when shared libs on.
- This patch reverts the "revert" and makes two minor changes
- The first is it also links in the MCParser lib when building the unittest. This should resolve the issue when building with with shared libs on and off
- The second renames the name of the unit test from `SystemZAsmLexer` to `SystemZAsmLexerTests` since the convention for unittest binaries is to suffix the name of the unit test with "Tests"

Reviewed By: Kai

Differential Revision: https://reviews.llvm.org/D98666
DeltaFile
+163-0llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
+14-0llvm/unittests/MC/SystemZ/CMakeLists.txt
+8-1llvm/include/llvm/MC/MCAsmInfo.h
+2-1llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp
+3-0llvm/lib/MC/MCParser/AsmLexer.cpp
+190-25 files

LLVM/project 4f9cc15llvm/include/llvm/MC MCAsmInfo.h, llvm/lib/MC/MCParser AsmLexer.cpp

Revert "[AsmParser][SystemZ][z/OS] Introducing HLASM Comment Syntax"

This reverts commit bcdd40f802a5dfd7b3ac11304e6099bfcdd25b1e.
See https://reviews.llvm.org/D98543.
DeltaFile
+0-163llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
+0-13llvm/unittests/MC/SystemZ/CMakeLists.txt
+1-8llvm/include/llvm/MC/MCAsmInfo.h
+1-2llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp
+0-3llvm/lib/MC/MCParser/AsmLexer.cpp
+2-1895 files

LLVM/project bcdd40fllvm/include/llvm/MC MCAsmInfo.h, llvm/lib/MC/MCParser AsmLexer.cpp

[AsmParser][SystemZ][z/OS] Introducing HLASM Comment Syntax

- This patch adds in support for the ordinary HLASM comment syntax asm
  statements (Reference - Chapter 7, Comment Statements, Ordinary Comment
  Statements)
- In brief, the ordinary comment syntax if used, must begin with the "*"
  character
- To achieve this, this patch makes use of the CommentString attribute
  provided in the base MCAsmInfo class
- In the SystemZMCAsmInfo class, the CommentString attribute was set to
  "*" based on the assembler dialect
- Furthermore, a new attribute RestrictCommentString, is provided to only
  treat a string as a comment if it appears at the start of the asm
  statement. Example: "jo *-4" is valid in HLASM (jump back 4 bytes from
  current point - similar to jo -4 in gnu asm) and we don't want "*-4" to
  be treated as a comment.
- RFC for HLASM Parser support implementation: https://lists.llvm.org/pipermail/llvm-dev/2021-January/147686.html

Reviewed By: scott.linder, Kai

    [2 lines not shown]
DeltaFile
+163-0llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
+13-0llvm/unittests/MC/SystemZ/CMakeLists.txt
+8-1llvm/include/llvm/MC/MCAsmInfo.h
+3-0llvm/lib/MC/MCParser/AsmLexer.cpp
+2-1llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp
+189-25 files

LLVM/project 19c56e1llvm/lib/MC/MCParser AsmLexer.cpp, llvm/test/MC/AsmParser preserve-comments.s

[MC] Fix ICE with non-newline terminated input

There is an explicit option for the lexer to support this, but we crash
when `-preserve-comments` is enabled because it checks for
`getTok().getString().empty()` to detect the case. This doesn't
work currently because the lexer reports this case as a string of length
1, containing a null byte.

Change the lexer to instead report this case via an empty string, as the
null terminator isn't logically a part of the textual input, and the
check for `.empty()` seems natural and obvious in the calling code.

Reviewed By: niravd

Differential Revision: https://reviews.llvm.org/D92681
DeltaFile
+4-0llvm/test/MC/AsmParser/preserve-comments.s
+1-1llvm/lib/MC/MCParser/AsmLexer.cpp
+1-0llvm/test/MC/AsmParser/Inputs/no-newline-at-end-of-file.s
+6-13 files

LLVM/project 07c4f1dllvm/include/llvm/MC/MCParser MCAsmLexer.h, llvm/lib/MC/MCParser MasmParser.cpp AsmLexer.cpp

[ms] [llvm-ml] Lex MASM strings, including escaping

Allow single-quoted strings and double-quoted character values, as well as doubled-quote escaping.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D89731
DeltaFile
+122-0llvm/test/tools/llvm-ml/strings.test
+15-65llvm/lib/MC/MCParser/MasmParser.cpp
+42-0llvm/lib/MC/MCParser/AsmLexer.cpp
+11-0llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+5-0llvm/include/llvm/MC/MCParser/MCAsmLexer.h
+1-1llvm/test/tools/llvm-ml/struct.test
+196-662 files not shown
+199-668 files

LLVM/project c65e9e7llvm/include/llvm/MC/MCParser MCAsmLexer.h, llvm/lib/MC/MCParser MasmParser.cpp AsmLexer.cpp

[ms] [llvm-ml] Add MASM hex float support

Implement MASM's syntax for specifying floats in raw hexadecimal bytes.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D87401
DeltaFile
+17-0llvm/lib/MC/MCParser/MasmParser.cpp
+8-0llvm/test/tools/llvm-ml/builtin_types.test
+5-0llvm/tools/llvm-mc/llvm-mc.cpp
+5-0llvm/lib/MC/MCParser/AsmLexer.cpp
+4-0llvm/include/llvm/MC/MCParser/MCAsmLexer.h
+2-0llvm/tools/llvm-ml/llvm-ml.cpp
+41-06 files

LLVM/project 6b70a83llvm/include/llvm/MC/MCParser MCAsmLexer.h, llvm/lib/MC/MCParser AsmLexer.cpp MasmParser.cpp

[ms] [llvm-ml] Add support for .radix directive, and accept all radix specifiers

Add support for .radix directive, and radix specifiers [yY] (binary), [oOqQ] (octal), and [tT] (decimal).

Also, when lexing MASM integers, require radix specifier; MASM requires that all literals without a radix specifier be treated as in the default radix. (e.g., 0100 = 100)

Relanding D87400, now with fewer ms-inline-asm tests broken!

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D88337
DeltaFile
+103-24llvm/lib/MC/MCParser/AsmLexer.cpp
+97-0llvm/test/tools/llvm-ml/radix.test
+55-0llvm/test/tools/llvm-ml/radix_errors.test
+18-10llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+23-0llvm/lib/MC/MCParser/MasmParser.cpp
+11-2llvm/include/llvm/MC/MCParser/MCAsmLexer.h
+307-362 files not shown
+309-378 files

LLVM/project b901b6allvm/include/llvm/MC/MCParser MCAsmLexer.h, llvm/lib/MC/MCParser AsmLexer.cpp MasmParser.cpp

Revert "[ms] [llvm-ml] Add support for .radix directive, and accept all radix specifiers"

This reverts commit 5dd1b6d612655c9006ba97a8b6487ded80719b48.
DeltaFile
+21-101llvm/lib/MC/MCParser/AsmLexer.cpp
+0-97llvm/test/tools/llvm-ml/radix.test
+0-60llvm/test/tools/llvm-ml/radix_errors.test
+0-23llvm/lib/MC/MCParser/MasmParser.cpp
+0-4llvm/include/llvm/MC/MCParser/MCAsmLexer.h
+0-3llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+21-2881 files not shown
+22-2887 files

LLVM/project aca7105llvm/lib/MC/MCParser AsmLexer.cpp

Fix include location (accidentally committed a local variation)
DeltaFile
+1-1llvm/lib/MC/MCParser/AsmLexer.cpp
+1-11 files

LLVM/project 5dd1b6dllvm/include/llvm/MC/MCParser MCAsmLexer.h, llvm/lib/MC/MCParser AsmLexer.cpp MasmParser.cpp

[ms] [llvm-ml] Add support for .radix directive, and accept all radix specifiers

Add support for .radix directive, and radix specifiers [yY] (binary), [oOqQ] (octal), and [tT] (decimal).

Also, when lexing MASM integers, require radix specifier; MASM requires that all literals without a radix specifier be treated as in the default radix. (e.g., 0100 = 100)

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D87400
DeltaFile
+102-22llvm/lib/MC/MCParser/AsmLexer.cpp
+97-0llvm/test/tools/llvm-ml/radix.test
+60-0llvm/test/tools/llvm-ml/radix_errors.test
+23-0llvm/lib/MC/MCParser/MasmParser.cpp
+4-0llvm/include/llvm/MC/MCParser/MCAsmLexer.h
+3-0llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+289-221 files not shown
+289-237 files

LLVM/project da69877llgo/third_party/gofrontend/libbacktrace configure, llgo/third_party/gofrontend/libffi configure

[DPWBS-1377] Merge community master into htc/master

The following TriCore files needed to be touched due to changes in the
upstream community:

TriCoreAsmParser.cpp:   8d5bf0422bc3c8cc7017602375122f7bfea70dab
TriCoreAsmPrinter.cpp:  6d2d589b06fcb31220bdf5aa09b7a6d5b34ef252

The following tests needed to be updated as well:

[Clang]
Preprocessor/init.c:    91cdbd521a38495c66e30636943563ca70d3c022

[LLVM]
copy-pseudo-register-invalid.mir:                   4ad76852584480b646d1ce360202e18591ea8938
legalize-bswap-invalid.mir:                         4ad76852584480b646d1ce360202e18591ea8938
legalize-invalid-inttoptr.mir:                      4ad76852584480b646d1ce360202e18591ea8938
legalize-store-invalid-memsize.mir:                 4ad76852584480b646d1ce360202e18591ea8938
prologue-epilogue-invalid-stack-size.mir:           4ad76852584480b646d1ce360202e18591ea8938

    [9 lines not shown]
DeltaFile
+0-18,792llgo/third_party/gofrontend/libffi/configure
+0-18,345llgo/third_party/gofrontend/libgo/configure
+13,710-2,810polly/lib/External/isl/include/isl/cpp.h
+0-15,156llgo/third_party/gofrontend/libbacktrace/configure
+8,769-881polly/lib/External/isl/include/isl/cpp-checked.h
+8,911-540polly/lib/External/isl/interface/isl.py
+31,390-56,52416,314 files not shown
+495,548-983,60016,320 files

LLVM/project ee2c0f7llvm/include/llvm/MC/MCParser MCAsmParser.h, llvm/lib/MC/MCParser MasmParser.cpp COFFMasmParser.cpp

[ms] [llvm-ml] Add a draft MASM parser

Summary:
Many directives are unavailable, and support for others may be limited.

This first draft has preliminary support for:
    - conditional directives (including errors),
    - data allocation (unsigned types up to 8 bytes, and ALIGN),
    - equates/variables (numeric and text),
    - and procedure directives (without parameters),
as well as COMMENT, ECHO, INCLUDE, INCLUDELIB, PUBLIC, and EXTERN. Text variables (aka text macros) are expanded in-place wherever the identifier occurs.

We deliberately ignore all ml.exe processor directives.

Prominent features not yet supported:
    - structs
    - macros (both procedures and functions)
    - procedures (with specified parameters)
    - substitution & expansion operators

    [12 lines not shown]
DeltaFile
+5,566-0llvm/lib/MC/MCParser/MasmParser.cpp
+386-0llvm/lib/MC/MCParser/COFFMasmParser.cpp
+22-8llvm/lib/MC/MCParser/AsmParser.cpp
+18-7llvm/lib/MC/MCParser/AsmLexer.cpp
+10-0llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
+9-1llvm/include/llvm/MC/MCParser/MCAsmParser.h
+6,011-1613 files not shown
+6,055-2119 files

LLVM/project 2c2a7bbclang/test/Analysis/Inputs/expected-plists retain-release.m.objcpp.plist retain-release.m.objc.plist, lldb/www/python_reference lldb-pysrc.html _lldb'-module.html

Merge community 'master' into HighTec htc/master
DeltaFile
+131,121-0llvm/test/MC/AMDGPU/gfx10_asm_all.s
+98,845-0llvm/test/MC/Disassembler/AMDGPU/gfx10_dasm_all.txt
+0-76,576lldb/www/python_reference/lldb-pysrc.html
+0-35,247lldb/www/python_reference/_lldb'-module.html
+26,304-0clang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist
+26,235-0clang/test/Analysis/Inputs/expected-plists/retain-release.m.objc.plist
+282,505-111,82349,584 files not shown
+3,612,145-1,757,40149,590 files

LLVM/project 3dd72eallvm/lib/MC/MCParser AsmLexer.cpp, llvm/lib/Support APFloat.cpp

[MC] Fix floating-point literal lexing.

This patch has three related fixes to improve float literal lexing:

1. Make AsmLexer::LexDigit handle floats without a decimal point more
   consistently.
2. Make AsmLexer::LexFloatLiteral print an error for floats which are
   apparently missing an "e".
3. Make APFloat::convertFromString use binutils-compatible exponent
   parsing.

Together, this fixes some cases where a float would be incorrectly
rejected, fixes some cases where the compiler would crash, and improves
diagnostics in some cases.

Patch by Brandon Jones.

Differential Revision: https://reviews.llvm.org/D57321

llvm-svn: 357214
DeltaFile
+27-30llvm/unittests/ADT/APFloatTest.cpp
+43-4llvm/test/MC/AsmParser/floating-literals.s
+13-10llvm/lib/MC/MCParser/AsmLexer.cpp
+4-1llvm/lib/Support/APFloat.cpp
+87-454 files

LLVM/project 6387fa2llvm/docs GlobalISel.rst, llvm/include/llvm/Analysis InstructionPrecedenceTracking.h

[NFC] Fix typos: preceeding -> preceding

llvm-svn: 354715
DeltaFile
+5-5llvm/include/llvm/DebugInfo/PDB/Native/RawTypes.h
+4-4llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+1-1llvm/include/llvm/Analysis/InstructionPrecedenceTracking.h
+1-1llvm/docs/GlobalISel.rst
+1-1llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+1-1llvm/lib/CodeGen/LiveDebugVariables.cpp
+13-133 files not shown
+16-169 files

LLVM/project 2946cd7clang-tools-extra/clang-tidy add_new_check.py, clang/include/clang-c CXString.h

Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
DeltaFile
+9-12compiler-rt/utils/generate_netbsd_syscalls.awk
+9-12clang-tools-extra/clang-tidy/add_new_check.py
+6-8compiler-rt/utils/generate_netbsd_ioctls.awk
+6-8llvm/utils/llvm-build/llvmbuild/main.py
+3-6clang/lib/AST/QualTypeNames.cpp
+4-4clang/include/clang-c/CXString.h
+37-5011,256 files not shown
+33,878-44,82911,262 files

LLVM/project 49482f8llvm/test/CodeGen/WebAssembly simd-comparisons.ll simd-arith.ll

[WebAssembly] replaced .param/.result by .functype

Summary:
This makes it easier/cleaner to generate a single signature from
this directive. Also:
- Adds the symbol name, such that we don't depend on the location
  of this directive anymore.
- Actually constructs the signature in the assembler, and make the
  assembler own it.
- Refactor the use of MVT vs ValType in the streamer and assembler
  to require less conversions overall.
- Changed 700 or so tests to use it.

Reviewers: sbc100, dschuff

Subscribers: jgravelle-google, eraman, aheejin, sunfish, jfb, llvm-commits

Differential Revision: https://reviews.llvm.org/D54652

llvm-svn: 347228
DeltaFile
+116-232llvm/test/CodeGen/WebAssembly/simd-comparisons.ll
+98-192llvm/test/CodeGen/WebAssembly/simd-arith.ll
+78-150llvm/test/CodeGen/WebAssembly/simd.ll
+96-132llvm/test/CodeGen/WebAssembly/simd-offset.ll
+96-96llvm/test/CodeGen/WebAssembly/atomic-rmw.ll
+48-72llvm/test/CodeGen/WebAssembly/simd-load-store-alignment.ll
+532-87468 files not shown
+1,195-1,86974 files

LLVM/project 953bdcellvm/include/llvm/MC/MCParser MCAsmLexer.h, llvm/lib/CodeGen/AsmPrinter AsmPrinterInlineAsm.cpp

[MC] Separate masm integer literal lexer support from inline asm

Summary:
This renames the IsParsingMSInlineAsm member variable of AsmLexer to
LexMasmIntegers and moves it up to MCAsmLexer. This is the only behavior
controlled by that variable. I added a public setter, so that it can be
set from outside or from the llvm-mc command line. We may need to
arrange things so that users can get this behavior from clang, but
that's future work.

I also put additional hex literal lexing functionality under this flag
to fix PR32973. It appears that this hex literal parsing wasn't intended
to be enabled in non-masm-style blocks.

Now, masm integers (0b1101 and 0ABCh) work in __asm blocks from clang,
but 0b label references work when using .intel_syntax in standalone .s
files.

However, 0b label references will *not* work from __asm blocks in clang.

    [17 lines not shown]
DeltaFile
+20-16llvm/lib/MC/MCParser/AsmLexer.cpp
+8-0llvm/test/MC/AArch64/macro-hex-int.s
+5-0llvm/include/llvm/MC/MCParser/MCAsmLexer.h
+3-2llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
+5-0llvm/tools/llvm-mc/llvm-mc.cpp
+3-1llvm/lib/MC/MCParser/AsmParser.cpp
+44-195 files not shown
+47-2611 files

LLVM/project 4cb2994llvm .gitattributes, llvm/docs GettingStartedVS.rst

[MC] Fix regression tests on Windows when git “core.autocrlf” is set to true.

Differential Revision: https://reviews.llvm.org/D39737

This is the second attempt to commit this. The test was broken on Linux in the first attempt.

llvm-svn: 318560
DeltaFile
+13-0llvm/test/MC/AsmParser/preserve-comments-crlf.s
+12-0llvm/.gitattributes
+5-0llvm/docs/GettingStartedVS.rst
+2-0llvm/lib/MC/MCParser/AsmLexer.cpp
+32-04 files

LLVM/project e827024llvm .gitattributes, llvm/docs GettingStartedVS.rst

Revert "[MC] Fix regression tests on Windows when git “core.autocrlf” is set to true."

This reverts commit r318528.

MC/AsmParser/preserve-comments-crlf.s fails on linux.

llvm-svn: 318533
DeltaFile
+0-13llvm/test/MC/AsmParser/preserve-comments-crlf.s
+0-12llvm/.gitattributes
+0-5llvm/docs/GettingStartedVS.rst
+0-2llvm/lib/MC/MCParser/AsmLexer.cpp
+0-324 files

LLVM/project ac35813llvm .gitattributes, llvm/docs GettingStartedVS.rst

[MC] Fix regression tests on Windows when git “core.autocrlf” is set to true.

Differential Revision: https://reviews.llvm.org/D39737

llvm-svn: 318528
DeltaFile
+13-0llvm/test/MC/AsmParser/preserve-comments-crlf.s
+12-0llvm/.gitattributes
+5-0llvm/docs/GettingStartedVS.rst
+2-0llvm/lib/MC/MCParser/AsmLexer.cpp
+32-04 files

LLVM/project b0c9e0dllvm/lib/MC/MCParser AsmLexer.cpp, llvm/test/MC/X86 crlf.test

[MC] Lex CRLF as one token

This will prevent doubling of line endings when parsing assembly and
emitting assembly.

Otherwise we'd parse the directive, consume the end of statement, hit
the next end of statement, and emit a fresh newline.

llvm-svn: 315943
DeltaFile
+9-1llvm/lib/MC/MCParser/AsmLexer.cpp
+5-0llvm/test/MC/X86/crlf.test
+14-12 files

LLVM/project 099960dllvm/include/llvm/ADT StringExtras.h, llvm/lib/MC/MCParser AsmLexer.cpp

[MC] - Don't assert when non-english characters are used.

I found that llvm-mc does not like non-english characters even in comments,
which it tries to tokenize.

Problem happens because of functions like isdigit(), isalnum() which takes
int argument and expects it is not negative.
But at the same time MCParser uses char* to store input buffer poiner, char has signed value,
so it is possible to pass negative value to one of functions from above and
that triggers an assert. 
Testcase for demonstration is provided.

To fix the issue helper functions were introduced in StringExtras.h

Differential revision: https://reviews.llvm.org/D38461

llvm-svn: 314883
DeltaFile
+13-12llvm/lib/MC/MCParser/AsmLexer.cpp
+15-0llvm/include/llvm/ADT/StringExtras.h
+14-0llvm/test/MC/AsmParser/non-english-characters.s
+42-123 files

LLVM/project 6bda14bllvm/lib/Fuzzer/afl afl_driver.cpp, llvm/lib/Target/AMDGPU AMDGPUTargetMachine.cpp AMDGPUAsmPrinter.cpp

Sort the remaining #include lines in include/... and lib/....

I did this a long time ago with a janky python script, but now
clang-format has built-in support for this. I fed clang-format every
line with a #include and let it re-sort things according to the precise
LLVM rules for include ordering baked into clang-format these days.

I've reverted a number of files where the results of sorting includes
isn't healthy. Either places where we have legacy code relying on
particular include ordering (where possible, I'll fix these separately)
or where we have particular formatting around #include lines that
I didn't want to disturb in this patch.

This patch is *entirely* mechanical. If you get merge conflicts or
anything, just ignore the changes in this patch and run clang-format
over your #include lines in the files.

Sorry for any noise here, but it is important to keep these things
stable. I was seeing an increasing number of patches with irrelevant

    [5 lines not shown]
DeltaFile
+10-10llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+8-8llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
+8-8llvm/lib/Target/X86/X86MCInstLower.cpp
+8-8llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+7-7llvm/lib/Fuzzer/afl/afl_driver.cpp
+5-5llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+46-46765 files not shown
+1,072-1,097771 files