]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/Core/File.cpp
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / lib / Core / File.cpp
1 //===- Core/File.cpp - A Container of Atoms -------------------------------===//
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 #include "lld/Core/File.h"
11 #include "lld/Core/LLVM.h"
12 #include <mutex>
13
14 namespace lld {
15
16 File::~File() {}
17
18 File::atom_collection_empty<DefinedAtom>       File::_noDefinedAtoms;
19 File::atom_collection_empty<UndefinedAtom>     File::_noUndefinedAtoms;
20 File::atom_collection_empty<SharedLibraryAtom> File::_noSharedLibraryAtoms;
21 File::atom_collection_empty<AbsoluteAtom>      File::_noAbsoluteAtoms;
22
23 std::error_code File::parse() {
24   std::lock_guard<std::mutex> lock(_parseMutex);
25   if (!_lastError.hasValue())
26     _lastError = doParse();
27   return _lastError.getValue();
28 }
29
30 } // namespace lld