Coverage Report

Created: 2017-09-21 03:39

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/tools/lld/lib/ReaderWriter/MachO/FlatNamespaceFile.h
Line
Count
Source
1
//===- lib/ReaderWriter/MachO/FlatNamespaceFile.h -------------------------===//
2
//
3
//                             The LLVM Linker
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 LLD_READER_WRITER_MACHO_FLAT_NAMESPACE_FILE_H
11
#define LLD_READER_WRITER_MACHO_FLAT_NAMESPACE_FILE_H
12
13
#include "lld/Core/SharedLibraryFile.h"
14
#include "llvm/Support/Debug.h"
15
16
namespace lld {
17
namespace mach_o {
18
19
//
20
// A FlateNamespaceFile instance may be added as a resolution source of last
21
// resort, depending on how -flat_namespace and -undefined are set.
22
//
23
class FlatNamespaceFile : public SharedLibraryFile {
24
public:
25
  FlatNamespaceFile(const MachOLinkingContext &context)
26
2
    : SharedLibraryFile("flat namespace") { }
27
28
4
  OwningAtomPtr<SharedLibraryAtom> exports(StringRef name) const override {
29
4
    return new (allocator()) MachOSharedLibraryAtom(*this, name, getDSOName(),
30
4
                                                    false);
31
4
  }
32
33
4
  StringRef getDSOName() const override { return "flat-namespace"; }
34
35
2
  const AtomRange<DefinedAtom> defined() const override {
36
2
    return _noDefinedAtoms;
37
2
  }
38
2
  const AtomRange<UndefinedAtom> undefined() const override {
39
2
    return _noUndefinedAtoms;
40
2
  }
41
42
2
  const AtomRange<SharedLibraryAtom> sharedLibrary() const override {
43
2
    return _noSharedLibraryAtoms;
44
2
  }
45
46
2
  const AtomRange<AbsoluteAtom> absolute() const override {
47
2
    return _noAbsoluteAtoms;
48
2
  }
49
50
2
  void clearAtoms() override {
51
2
    _noDefinedAtoms.clear();
52
2
    _noUndefinedAtoms.clear();
53
2
    _noSharedLibraryAtoms.clear();
54
2
    _noAbsoluteAtoms.clear();
55
2
  }
56
};
57
58
} // namespace mach_o
59
} // namespace lld
60
61
#endif // LLD_READER_WRITER_MACHO_FLAT_NAMESPACE_FILE_H