1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/lib
Anirudh Prasad d7da6c0d43 [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

Reviewed By: abhina.sreeskantharajan, myiwanch

Differential Revision: https://reviews.llvm.org/D99286
2021-04-13 11:15:09 -04:00
..
Analysis [TTI] NFC: Change get[Interleaved]MemoryOpCost to return InstructionCost 2021-04-13 14:21:02 +01:00
AsmParser
BinaryFormat
Bitcode
Bitstream
CodeGen StackProtector: ensure protection does not interfere with tail call frame. 2021-04-13 15:14:57 +01:00
DebugInfo [CodeView] Fix the ARM64 CPUType enum 2021-04-13 12:54:22 +03:00
Demangle
DWARFLinker [dsymutil] Stop emulating dsymutil-classic CIE caching behavior 2021-04-06 20:15:41 -07:00
ExecutionEngine
Extensions
FileCheck
Frontend
Fuzzer
FuzzMutate
InterfaceStub
IR Revert "Reapply "[DebugInfo] Use variadic debug values to salvage BinOps and GEP instrs with non-const operands"" 2021-04-12 20:10:17 -07:00
IRReader
LineEditor
Linker
LTO
MC [AsmParser][SystemZ][z/OS] Add in support to allow use of additional comment strings. 2021-04-13 11:15:09 -04:00
MCA
Object
ObjectYAML [lld] Fixed CodeView GuidAdapter::format to handle GUID bytes in the right order. 2021-04-09 05:29:14 +04:00
Option
Passes [Passes] Add relative lookup table converter pass 2021-04-13 01:29:41 +00:00
ProfileData [CSSPGO] Fix dangling context strings and improve profile order consistency and error handling 2021-04-10 12:39:10 -07:00
Remarks
Support [X86] Support -march=rocketlake 2021-04-13 09:48:13 +08:00
TableGen [TableGen] Fix bug in recent change to ListInit::convertInitListSlice() 2021-04-12 09:44:39 -04:00
Target [AsmParser][SystemZ][z/OS] Add in support to allow use of additional comment strings. 2021-04-13 11:15:09 -04:00
Testing
TextAPI
ToolDrivers
Transforms [TTI] NFC: Change getArithmeticReductionCost to return InstructionCost 2021-04-13 14:20:59 +01:00
WindowsManifest
XRay
CMakeLists.txt