summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lld/lib/Core/File.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/llvm/lld/lib/Core/File.cpp')
-rw-r--r--gnu/llvm/lld/lib/Core/File.cpp28
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