2013-01-09 07:43:11 +08:00
|
|
|
//===- Core/File.cpp - A Container of Atoms -------------------------------===//
|
2011-12-18 16:27:59 +08:00
|
|
|
//
|
|
|
|
// 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"
|
2012-04-04 02:39:40 +08:00
|
|
|
#include "lld/Core/LLVM.h"
|
2015-01-16 23:54:13 +08:00
|
|
|
#include <mutex>
|
2011-12-18 16:27:59 +08:00
|
|
|
|
|
|
|
namespace lld {
|
|
|
|
|
2016-03-23 01:15:50 +08:00
|
|
|
File::~File() { }
|
2014-09-09 02:01:42 +08:00
|
|
|
|
2015-04-09 07:05:59 +08:00
|
|
|
File::AtomVector<DefinedAtom> File::_noDefinedAtoms;
|
|
|
|
File::AtomVector<UndefinedAtom> File::_noUndefinedAtoms;
|
|
|
|
File::AtomVector<SharedLibraryAtom> File::_noSharedLibraryAtoms;
|
|
|
|
File::AtomVector<AbsoluteAtom> File::_noAbsoluteAtoms;
|
2013-01-05 10:22:35 +08:00
|
|
|
|
2015-01-16 23:54:13 +08:00
|
|
|
std::error_code File::parse() {
|
|
|
|
std::lock_guard<std::mutex> lock(_parseMutex);
|
|
|
|
if (!_lastError.hasValue())
|
|
|
|
_lastError = doParse();
|
|
|
|
return _lastError.getValue();
|
|
|
|
}
|
|
|
|
|
2013-01-24 06:32:56 +08:00
|
|
|
} // namespace lld
|