diff options
Diffstat (limited to 'lib/Core/File.cpp')
-rw-r--r-- | lib/Core/File.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/Core/File.cpp b/lib/Core/File.cpp new file mode 100644 index 000000000000..dbac86b368aa --- /dev/null +++ b/lib/Core/File.cpp @@ -0,0 +1,30 @@ +//===- Core/File.cpp - A Container of Atoms -------------------------------===// +// +// The LLVM Linker +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "lld/Core/File.h" +#include "lld/Core/LLVM.h" +#include <mutex> + +namespace lld { + +File::~File() {} + +File::atom_collection_empty<DefinedAtom> File::_noDefinedAtoms; +File::atom_collection_empty<UndefinedAtom> File::_noUndefinedAtoms; +File::atom_collection_empty<SharedLibraryAtom> File::_noSharedLibraryAtoms; +File::atom_collection_empty<AbsoluteAtom> File::_noAbsoluteAtoms; + +std::error_code File::parse() { + std::lock_guard<std::mutex> lock(_parseMutex); + if (!_lastError.hasValue()) + _lastError = doParse(); + return _lastError.getValue(); +} + +} // namespace lld |