Coverage Report

Created: 2018-11-16 02:38

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/MC/MCSymbolCOFF.h
Line
Count
Source
1
//===- MCSymbolCOFF.h -  ----------------------------------------*- 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_MCSYMBOLCOFF_H
11
#define LLVM_MC_MCSYMBOLCOFF_H
12
13
#include "llvm/MC/MCSymbol.h"
14
#include <cstdint>
15
16
namespace llvm {
17
18
class MCSymbolCOFF : public MCSymbol {
19
  /// This corresponds to the e_type field of the COFF symbol.
20
  mutable uint16_t Type = 0;
21
22
  enum SymbolFlags : uint16_t {
23
    SF_ClassMask = 0x00FF,
24
    SF_ClassShift = 0,
25
26
    SF_WeakExternal = 0x0100,
27
    SF_SafeSEH = 0x0200,
28
  };
29
30
public:
31
  MCSymbolCOFF(const StringMapEntry<bool> *Name, bool isTemporary)
32
41.6k
      : MCSymbol(SymbolKindCOFF, Name, isTemporary) {}
33
34
5.96k
  uint16_t getType() const {
35
5.96k
    return Type;
36
5.96k
  }
37
633
  void setType(uint16_t Ty) const {
38
633
    Type = Ty;
39
633
  }
40
41
1.76k
  uint16_t getClass() const {
42
1.76k
    return (getFlags() & SF_ClassMask) >> SF_ClassShift;
43
1.76k
  }
44
628
  void setClass(uint16_t StorageClass) const {
45
628
    modifyFlags(StorageClass << SF_ClassShift, SF_ClassMask);
46
628
  }
47
48
1.76k
  bool isWeakExternal() const {
49
1.76k
    return getFlags() & SF_WeakExternal;
50
1.76k
  }
51
8
  void setIsWeakExternal() const {
52
8
    modifyFlags(SF_WeakExternal, SF_WeakExternal);
53
8
  }
54
55
5
  bool isSafeSEH() const {
56
5
    return getFlags() & SF_SafeSEH;
57
5
  }
58
5
  void setIsSafeSEH() const {
59
5
    modifyFlags(SF_SafeSEH, SF_SafeSEH);
60
5
  }
61
62
  static bool classof(const MCSymbol *S) { return S->isCOFF(); }
63
};
64
65
} // end namespace llvm
66
67
#endif // LLVM_MC_MCSYMBOLCOFF_H