blob: a4c3e7ec4abbb20e1bccefe73a9703819b7528a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
//===- lib/ReaderWriter/PECOFF/PECOFFTargetInfo.cpp -----------------------===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "lld/ReaderWriter/PECOFFTargetInfo.h"
#include "lld/ReaderWriter/Reader.h"
#include "lld/ReaderWriter/Writer.h"
#include "llvm/Support/Debug.h"
namespace lld {
error_code PECOFFTargetInfo::parseFile(
std::unique_ptr<MemoryBuffer> &mb,
std::vector<std::unique_ptr<File>> &result) const {
return _reader->parseFile(mb, result);
}
bool PECOFFTargetInfo::validate(raw_ostream &diagnostics) {
if (_stackReserve < _stackCommit) {
diagnostics << "Invalid stack size: reserve size must be equal to or "
<< "greater than commit size, but got "
<< _stackCommit << " and " << _stackReserve << ".\n";
return true;
}
_reader = createReaderPECOFF(*this);
_writer = createWriterPECOFF(*this);
return false;
}
Writer &PECOFFTargetInfo::writer() const {
return *_writer;
}
ErrorOr<Reference::Kind>
PECOFFTargetInfo::relocKindFromString(StringRef str) const {
return make_error_code(yaml_reader_error::illegal_value);
}
ErrorOr<std::string>
PECOFFTargetInfo::stringFromRelocKind(Reference::Kind kind) const {
return make_error_code(yaml_reader_error::illegal_value);
}
} // end namespace lld
|