diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:01:22 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:01:22 +0000 | 
| commit | 71d5a2540a98c81f5bcaeb48805e0e2881f530ef (patch) | |
| tree | 5343938942df402b49ec7300a1c25a2d4ccd5821 /lib/Target/SystemZ/AsmParser | |
| parent | 31bbf64f3a4974a2d6c8b3b27ad2f519caf74057 (diff) | |
Diffstat (limited to 'lib/Target/SystemZ/AsmParser')
| -rw-r--r-- | lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp | 23 | 
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp b/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp index a94717c93456..3f91ca9035a6 100644 --- a/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp +++ b/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp @@ -8,16 +8,31 @@  //===----------------------------------------------------------------------===//  #include "MCTargetDesc/SystemZMCTargetDesc.h" +#include "llvm/ADT/SmallVector.h"  #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/StringRef.h"  #include "llvm/MC/MCContext.h"  #include "llvm/MC/MCExpr.h"  #include "llvm/MC/MCInst.h"  #include "llvm/MC/MCInstBuilder.h" +#include "llvm/MC/MCParser/MCAsmLexer.h" +#include "llvm/MC/MCParser/MCAsmParser.h" +#include "llvm/MC/MCParser/MCAsmParserExtension.h"  #include "llvm/MC/MCParser/MCParsedAsmOperand.h"  #include "llvm/MC/MCParser/MCTargetAsmParser.h"  #include "llvm/MC/MCStreamer.h"  #include "llvm/MC/MCSubtargetInfo.h" +#include "llvm/Support/Casting.h" +#include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/SMLoc.h"  #include "llvm/Support/TargetRegistry.h" +#include <algorithm> +#include <cassert> +#include <cstddef> +#include <cstdint> +#include <iterator> +#include <memory> +#include <string>  using namespace llvm; @@ -31,6 +46,7 @@ static bool inRange(const MCExpr *Expr, int64_t MinValue, int64_t MaxValue) {  }  namespace { +  enum RegisterKind {    GR32Reg,    GRH32Reg, @@ -56,7 +72,6 @@ enum MemoryKind {  };  class SystemZOperand : public MCParsedAsmOperand { -public:  private:    enum OperandKind {      KindInvalid, @@ -140,12 +155,14 @@ public:                                                         SMLoc EndLoc) {      return make_unique<SystemZOperand>(KindInvalid, StartLoc, EndLoc);    } +    static std::unique_ptr<SystemZOperand> createToken(StringRef Str, SMLoc Loc) {      auto Op = make_unique<SystemZOperand>(KindToken, Loc, Loc);      Op->Token.Data = Str.data();      Op->Token.Length = Str.size();      return Op;    } +    static std::unique_ptr<SystemZOperand>    createReg(RegisterKind Kind, unsigned Num, SMLoc StartLoc, SMLoc EndLoc) {      auto Op = make_unique<SystemZOperand>(KindReg, StartLoc, EndLoc); @@ -153,12 +170,14 @@ public:      Op->Reg.Num = Num;      return Op;    } +    static std::unique_ptr<SystemZOperand>    createImm(const MCExpr *Expr, SMLoc StartLoc, SMLoc EndLoc) {      auto Op = make_unique<SystemZOperand>(KindImm, StartLoc, EndLoc);      Op->Imm = Expr;      return Op;    } +    static std::unique_ptr<SystemZOperand>    createMem(MemoryKind MemKind, RegisterKind RegKind, unsigned Base,              const MCExpr *Disp, unsigned Index, const MCExpr *LengthImm, @@ -175,6 +194,7 @@ public:        Op->Mem.Length.Reg = LengthReg;      return Op;    } +    static std::unique_ptr<SystemZOperand>    createImmTLS(const MCExpr *Imm, const MCExpr *Sym,                 SMLoc StartLoc, SMLoc EndLoc) { @@ -503,6 +523,7 @@ public:      return parsePCRel(Operands, -(1LL << 32), (1LL << 32) - 1, true);    }  }; +  } // end anonymous namespace  #define GET_REGISTER_MATCHER  | 
