1 //===- Core/File.cpp - A Container of Atoms -------------------------------===//
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "lld/Core/File.h"
11 #include "lld/Core/LLVM.h"
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;
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();