[AsmParser][SystemZ][z/OS] Reject character and string literals for HLASM
authorAnirudh Prasad <anirudh_prasad@hotmail.com>
Wed, 5 May 2021 14:21:27 +0000 (10:21 -0400)
committerAnirudh Prasad <anirudh_prasad@hotmail.com>
Wed, 5 May 2021 14:21:55 +0000 (10:21 -0400)
commitae2aef13618beb8cb86e8b137a8ddbc846461169
tree09ffe03b9f118723a9a15b8dd3c8825c096d260d
parent3f4bad5eadacfc5322817eaa062dd272b52cfc54
[AsmParser][SystemZ][z/OS] Reject character and string literals for HLASM

- As per the HLASM support we are providing, i.e. support only for the first parameter of the inline asm block, only pertaining to Z machine instructions defined in LLVM, character literals and string literals are not supported (see Figure 4 - https://www-01.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R3sc264940/$file/asmr1023.pdf for more information)
- This patch explicitly rejects the usage of char literals and string literals (for example "abc 'a'") when the relevant field is set
- This is achieved by introducing a field called `LexHLASMStrings` in MCAsmLexer similar to `LexMasmStrings`

Reviewed By: abhina.sreeskantharajan, Kai

Differential Revision: https://reviews.llvm.org/D101660
llvm/include/llvm/MC/MCParser/MCAsmLexer.h
llvm/lib/MC/MCParser/AsmLexer.cpp
llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp