diff options
author | 2020-08-03 14:32:29 +0000 | |
---|---|---|
committer | 2020-08-03 14:32:29 +0000 | |
commit | ece8a53058b183aa0a669e21c57225431117089d (patch) | |
tree | d015158a7940b850696bd234528db6544daf9a69 /gnu/llvm/lld/lib/Core/File.cpp | |
parent | Import LLVM 10.0.0 release including clang, lld and lldb. (diff) | |
download | wireguard-openbsd-ece8a53058b183aa0a669e21c57225431117089d.tar.xz wireguard-openbsd-ece8a53058b183aa0a669e21c57225431117089d.zip |
Import LLVM 10.0.0 release including clang, lld and lldb.
ok hackroom
tested by plenty
Diffstat (limited to 'gnu/llvm/lld/lib/Core/File.cpp')
-rw-r--r-- | gnu/llvm/lld/lib/Core/File.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gnu/llvm/lld/lib/Core/File.cpp b/gnu/llvm/lld/lib/Core/File.cpp new file mode 100644 index 00000000000..ce33923c136 --- /dev/null +++ b/gnu/llvm/lld/lib/Core/File.cpp @@ -0,0 +1,28 @@ +//===- Core/File.cpp - A Container of Atoms -------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "lld/Core/File.h" +#include <mutex> + +namespace lld { + +File::~File() = default; + +File::AtomVector<DefinedAtom> File::_noDefinedAtoms; +File::AtomVector<UndefinedAtom> File::_noUndefinedAtoms; +File::AtomVector<SharedLibraryAtom> File::_noSharedLibraryAtoms; +File::AtomVector<AbsoluteAtom> File::_noAbsoluteAtoms; + +std::error_code File::parse() { + std::lock_guard<std::mutex> lock(_parseMutex); + if (!_lastError.hasValue()) + _lastError = doParse(); + return _lastError.getValue(); +} + +} // end namespace lld |