From fb911942f1434f3d1750f83f25f5e42c80e60638 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 24 Mar 2015 21:31:36 +0000 Subject: Vendor import of lld trunk r233088: https://llvm.org/svn/llvm-project/lld/trunk@233088 --- lib/Core/File.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lib/Core/File.cpp (limited to 'lib/Core/File.cpp') 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 + +namespace lld { + +File::~File() {} + +File::atom_collection_empty File::_noDefinedAtoms; +File::atom_collection_empty File::_noUndefinedAtoms; +File::atom_collection_empty File::_noSharedLibraryAtoms; +File::atom_collection_empty File::_noAbsoluteAtoms; + +std::error_code File::parse() { + std::lock_guard lock(_parseMutex); + if (!_lastError.hasValue()) + _lastError = doParse(); + return _lastError.getValue(); +} + +} // namespace lld -- cgit v1.2.3