10#include "llvm/Object/COFF.h"
11#include "llvm/Object/ObjectFile.h"
16 static StringRef Formats[] = {
"obj",
"raw"};
21ObjectFilePCHContainerReader::ExtractPCH(llvm::MemoryBufferRef Buffer)
const {
23 auto OFOrErr = llvm::object::ObjectFile::createObjectFile(Buffer);
25 auto &OF = OFOrErr.get();
26 bool IsCOFF = isa<llvm::object::COFFObjectFile>(*OF);
28 for (
auto &Section : OF->sections()) {
33 consumeError(NameOrErr.takeError());
35 if ((!IsCOFF && Name ==
"__clangast") || (IsCOFF && Name ==
"clangast")) {
39 handleAllErrors(
E.takeError(), [&](
const llvm::ErrorInfoBase &EIB) {
40 EIB.log(llvm::errs());
47 handleAllErrors(OFOrErr.takeError(), [&](
const llvm::ErrorInfoBase &EIB) {
48 if (EIB.convertToErrorCode() ==
49 llvm::object::object_error::invalid_file_type)
51 PCH = Buffer.getBuffer();
53 EIB.log(llvm::errs());
The JSON file list parser is used to communicate input to InstallAPI.
@ PCH
Disable validation for a precompiled header and the modules it depends on.