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::AtomVector<DefinedAtom> File::_noDefinedAtoms;
19 File::AtomVector<UndefinedAtom> File::_noUndefinedAtoms;
20 File::AtomVector<SharedLibraryAtom> File::_noSharedLibraryAtoms;
21 File::AtomVector<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
31