1 //===- Core/File.cpp - A Container of Atoms -------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "lld/Core/File.h"
10 #include <mutex>
11 
12 namespace lld {
13 
14 File::~File() = default;
15 
16 File::AtomVector<DefinedAtom> File::_noDefinedAtoms;
17 File::AtomVector<UndefinedAtom> File::_noUndefinedAtoms;
18 File::AtomVector<SharedLibraryAtom> File::_noSharedLibraryAtoms;
19 File::AtomVector<AbsoluteAtom> File::_noAbsoluteAtoms;
20 
parse()21 std::error_code File::parse() {
22   std::lock_guard<std::mutex> lock(_parseMutex);
23   if (!_lastError.hasValue())
24     _lastError = doParse();
25   return _lastError.getValue();
26 }
27 
28 } // end namespace lld
29