summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCObjectFormat.h
blob: 5c3f003696065eb40b96110fe9f2f4e5d367d800 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//===-- llvm/MC/MCObjectFormat.h - Object Format Info -----------*- 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_MCOBJECTFORMAT_H
#define LLVM_MC_MCOBJECTFORMAT_H

namespace llvm {
class MCSymbol;

class MCObjectFormat {
public:
  virtual ~MCObjectFormat();

  /// isAbsolute - Check if A - B is an absolute value
  ///
  /// \param InSet - True if this expression is in a set. For example:
  ///   a:
  ///   ...
  ///   b:
  ///   tmp = a - b
  ///       .long tmp
  /// \param A - LHS
  /// \param B - RHS
  virtual bool isAbsolute(bool InSet, const MCSymbol &A,
                          const MCSymbol &B) const = 0;
};

class MCELFObjectFormat : public MCObjectFormat {
public:
  virtual bool isAbsolute(bool InSet, const MCSymbol &A,
                          const MCSymbol &B) const;
};

class MCMachOObjectFormat : public MCObjectFormat {
public:
  virtual bool isAbsolute(bool InSet, const MCSymbol &A,
                          const MCSymbol &B) const;
};

class MCCOFFObjectFormat : public MCObjectFormat {
public:
  virtual bool isAbsolute(bool InSet, const MCSymbol &A,
                          const MCSymbol &B) const;
};

}  // End llvm namespace

#endif