Coverage Report

Created: 2018-09-19 08:35

/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
37.0k
      : MCSymbol(SymbolKindCOFF, Name, isTemporary) {}
33
34
4.93k
  uint16_t getType() const {
35
4.93k
    return Type;
36
4.93k
  }
37
453
  void setType(uint16_t Ty) const {
38
453
    Type = Ty;
39
453
  }
40
41
1.38k
  uint16_t getClass() const {
42
1.38k
    return (getFlags() & SF_ClassMask) >> SF_ClassShift;
43
1.38k
  }
44
450
  void setClass(uint16_t StorageClass) const {
45
450
    modifyFlags(StorageClass << SF_ClassShift, SF_ClassMask);
46
450
  }
47
48
1.38k
  bool isWeakExternal() const {
49
1.38k
    return getFlags() & SF_WeakExternal;
50
1.38k
  }
51
8
  void setIsWeakExternal() const {
52
8
    modifyFlags(SF_WeakExternal, SF_WeakExternal);
53
8
  }
54
55
3
  bool isSafeSEH() const {
56
3
    return getFlags() & SF_SafeSEH;
57
3
  }
58
3
  void setIsSafeSEH() const {
59
3
    modifyFlags(SF_SafeSEH, SF_SafeSEH);
60
3
  }
61
62
  static bool classof(const MCSymbol *S) { return S->isCOFF(); }
63
};
64
65
} // end namespace llvm
66
67
#endif // LLVM_MC_MCSYMBOLCOFF_H