]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lld/lib/Core/File.cpp
Merge compiler-rt trunk r321414 to contrib/compiler-rt.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lld / 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 <mutex>
12
13 namespace lld {
14
15 File::~File() = default;
16
17 File::AtomVector<DefinedAtom> File::_noDefinedAtoms;
18 File::AtomVector<UndefinedAtom> File::_noUndefinedAtoms;
19 File::AtomVector<SharedLibraryAtom> File::_noSharedLibraryAtoms;
20 File::AtomVector<AbsoluteAtom> File::_noAbsoluteAtoms;
21
22 std::error_code File::parse() {
23   std::lock_guard<std::mutex> lock(_parseMutex);
24   if (!_lastError.hasValue())
25     _lastError = doParse();
26   return _lastError.getValue();
27 }
28
29 } // end namespace lld