summaryrefslogtreecommitdiffstats
path: root/lld/lib/Core/File.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/lib/Core/File.cpp')
-rw-r--r--lld/lib/Core/File.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lld/lib/Core/File.cpp b/lld/lib/Core/File.cpp
index 624fca9386d..dbac86b368a 100644
--- a/lld/lib/Core/File.cpp
+++ b/lld/lib/Core/File.cpp
@@ -9,6 +9,7 @@
#include "lld/Core/File.h"
#include "lld/Core/LLVM.h"
+#include <mutex>
namespace lld {
@@ -19,4 +20,11 @@ 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
OpenPOWER on IntegriCloud