Nick Kledzik | 80fe907 | 2013-01-08 23:43:11 +0000 | [diff] [blame] | 1 | //===- Core/File.cpp - A Container of Atoms -------------------------------===// |
Michael J. Spencer | 773a8fb | 2011-12-18 08:27:59 +0000 | [diff] [blame] | 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Michael J. Spencer | 773a8fb | 2011-12-18 08:27:59 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #include "lld/Core/File.h" |
Rui Ueyama | d4730ea | 2015-01-16 15:54:13 +0000 | [diff] [blame] | 10 | #include <mutex> |
Michael J. Spencer | 773a8fb | 2011-12-18 08:27:59 +0000 | [diff] [blame] | 11 | |
| 12 | namespace lld { |
| 13 | |
Eugene Zelenko | 22886a2 | 2016-11-05 01:00:56 +0000 | [diff] [blame] | 14 | File::~File() = default; |
Rui Ueyama | 553ac40 | 2014-09-08 18:01:42 +0000 | [diff] [blame] | 15 | |
Rui Ueyama | de40bd4 | 2015-04-08 23:05:59 +0000 | [diff] [blame] | 16 | File::AtomVector<DefinedAtom> File::_noDefinedAtoms; |
| 17 | File::AtomVector<UndefinedAtom> File::_noUndefinedAtoms; |
| 18 | File::AtomVector<SharedLibraryAtom> File::_noSharedLibraryAtoms; |
| 19 | File::AtomVector<AbsoluteAtom> File::_noAbsoluteAtoms; |
Nick Kledzik | 6b079f5 | 2013-01-05 02:22:35 +0000 | [diff] [blame] | 20 | |
Rui Ueyama | d4730ea | 2015-01-16 15:54:13 +0000 | [diff] [blame] | 21 | std::error_code File::parse() { |
| 22 | std::lock_guard<std::mutex> lock(_parseMutex); |
| 23 | if (!_lastError.hasValue()) |
| 24 | _lastError = doParse(); |
| 25 | return _lastError.getValue(); |
| 26 | } |
| 27 | |
Eugene Zelenko | 22886a2 | 2016-11-05 01:00:56 +0000 | [diff] [blame] | 28 | } // end namespace lld |