diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-08-27 17:46:59 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-08-27 17:46:59 -0400 |
| commit | 4794281d64b3482daf26a9bbfd2898a3a221b893 (patch) | |
| tree | 54f6d3c7e3e6cb455d7c76d2d484ebe08685fb1a /deps/lld/lib/Core/File.cpp | |
| parent | ebdc6b594ddc0762ed9e41b5f36e6da5e03c19e0 (diff) | |
| download | zig-4794281d64b3482daf26a9bbfd2898a3a221b893.tar.gz zig-4794281d64b3482daf26a9bbfd2898a3a221b893.zip | |
embed LLD 5.0.0
This is 48aaa9f66120f72b5d7e4a90b32fee40a3386ce9 from the
git monorepo.
Diffstat (limited to 'deps/lld/lib/Core/File.cpp')
| -rw-r--r-- | deps/lld/lib/Core/File.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/deps/lld/lib/Core/File.cpp b/deps/lld/lib/Core/File.cpp new file mode 100644 index 0000000000..30ded091a9 --- /dev/null +++ b/deps/lld/lib/Core/File.cpp @@ -0,0 +1,29 @@ +//===- 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 <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 |
