Make EmitIntValue more efficient and more like what we do for leb128. The
[oota-llvm.git] / include / llvm / MC / MCObjectFormat.h
1 //===-- llvm/MC/MCObjectFormat.h - Object Format Info -----------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_MC_MCOBJECTFORMAT_H
11 #define LLVM_MC_MCOBJECTFORMAT_H
12
13 namespace llvm {
14 class MCSymbol;
15
16 class MCObjectFormat {
17 public:
18   virtual ~MCObjectFormat();
19
20   /// isAbsolute - Check if A - B is an absolute value
21   ///
22   /// \param InSet - True if this expression is in a set. For example:
23   ///   a:
24   ///   ...
25   ///   b:
26   ///   tmp = a - b
27   ///       .long tmp
28   /// \param A - LHS
29   /// \param B - RHS
30   virtual bool isAbsolute(bool InSet, const MCSymbol &A,
31                           const MCSymbol &B) const = 0;
32 };
33
34 class MCELFObjectFormat : public MCObjectFormat {
35 public:
36   virtual bool isAbsolute(bool InSet, const MCSymbol &A,
37                           const MCSymbol &B) const;
38 };
39
40 class MCMachOObjectFormat : public MCObjectFormat {
41 public:
42   virtual bool isAbsolute(bool InSet, const MCSymbol &A,
43                           const MCSymbol &B) const;
44 };
45
46 class MCCOFFObjectFormat : public MCObjectFormat {
47 public:
48   virtual bool isAbsolute(bool InSet, const MCSymbol &A,
49                           const MCSymbol &B) const;
50 };
51
52 }  // End llvm namespace
53
54 #endif