From 001a94a0e32b75582818ceb25f721f15f7ded049 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 14 Jan 2010 21:20:55 +0000 Subject: [PATCH] introduce the MCParsedAsmOperand class. llvm-svn: 93454 --- include/llvm/MC/MCParsedAsmOperand.h | 28 +++++++++++++++++++++++ lib/Target/X86/AsmParser/X86AsmParser.cpp | 3 ++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 include/llvm/MC/MCParsedAsmOperand.h diff --git a/include/llvm/MC/MCParsedAsmOperand.h b/include/llvm/MC/MCParsedAsmOperand.h new file mode 100644 index 00000000000..7c9e9e65c1e --- /dev/null +++ b/include/llvm/MC/MCParsedAsmOperand.h @@ -0,0 +1,28 @@ +//===-- llvm/MC/MCParsedAsmOperand.h - Asm Parser Operand -------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_MC_MCASMOPERAND_H +#define LLVM_MC_MCASMOPERAND_H + +namespace llvm { + +/// MCParsedAsmOperand - This abstract class represents a source-level assembly +/// instruction operand. It should be subclassed by target-specific code. This +/// base class is used by target-independent clients and is the interface +/// between parsing an asm instruction and recognizing it. +class MCParsedAsmOperand { +public: + MCParsedAsmOperand(); + virtual ~MCParsedAsmOperand() = 0; + // TODO: Out of line vfun. +}; + +} // end namespace llvm. + +#endif diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index c357b4d0dee..1237c45c5f9 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -15,6 +15,7 @@ #include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInst.h" +#include "llvm/MC/MCParsedAsmOperand.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetAsmParser.h" @@ -71,7 +72,7 @@ namespace { /// X86Operand - Instances of this class represent a parsed X86 machine /// instruction. -struct X86Operand { +struct X86Operand : public MCParsedAsmOperand { enum { Token, Register,