197c3811cSEd Maste //===- Core/File.cpp - A Container of Atoms -------------------------------===// 297c3811cSEd Maste // 397c3811cSEd Maste // The LLVM Linker 497c3811cSEd Maste // 597c3811cSEd Maste // This file is distributed under the University of Illinois Open Source 697c3811cSEd Maste // License. See LICENSE.TXT for details. 797c3811cSEd Maste // 897c3811cSEd Maste //===----------------------------------------------------------------------===// 997c3811cSEd Maste 1097c3811cSEd Maste #include "lld/Core/File.h" 1197c3811cSEd Maste #include <mutex> 1297c3811cSEd Maste 1397c3811cSEd Maste namespace lld { 1497c3811cSEd Maste 15*1189dbaaSDimitry Andric File::~File() = default; 1697c3811cSEd Maste 1797c3811cSEd Maste File::AtomVector<DefinedAtom> File::_noDefinedAtoms; 1897c3811cSEd Maste File::AtomVector<UndefinedAtom> File::_noUndefinedAtoms; 1997c3811cSEd Maste File::AtomVector<SharedLibraryAtom> File::_noSharedLibraryAtoms; 2097c3811cSEd Maste File::AtomVector<AbsoluteAtom> File::_noAbsoluteAtoms; 2197c3811cSEd Maste parse()2297c3811cSEd Mastestd::error_code File::parse() { 2397c3811cSEd Maste std::lock_guard<std::mutex> lock(_parseMutex); 2497c3811cSEd Maste if (!_lastError.hasValue()) 2597c3811cSEd Maste _lastError = doParse(); 2697c3811cSEd Maste return _lastError.getValue(); 2797c3811cSEd Maste } 2897c3811cSEd Maste 29*1189dbaaSDimitry Andric } // end namespace lld 30