forked from OSchip/llvm-project
Revert "ASTReader: Copy input file offset data to avoid unaligned accesses"
We can do this better by changing the type to unaligned_uint64_t and paying the cost on use instead of up front. This reverts r240228 llvm-svn: 240246
This commit is contained in:
parent
3f31bd6dc0
commit
ca9c0ccbc0
|
@ -206,7 +206,7 @@ public:
|
|||
llvm::BitstreamCursor InputFilesCursor;
|
||||
|
||||
/// \brief Offsets for all of the input file entries in the AST file.
|
||||
std::vector<uint64_t> InputFileOffsets;
|
||||
const uint64_t *InputFileOffsets;
|
||||
|
||||
/// \brief The input files that have been loaded from this AST file.
|
||||
std::vector<InputFile> InputFilesLoaded;
|
||||
|
|
|
@ -2304,21 +2304,13 @@ ASTReader::ReadControlBlock(ModuleFile &F,
|
|||
return Result;
|
||||
break;
|
||||
|
||||
case INPUT_FILE_OFFSETS: {
|
||||
case INPUT_FILE_OFFSETS:
|
||||
NumInputs = Record[0];
|
||||
NumUserInputs = Record[1];
|
||||
F.InputFileOffsets.clear();
|
||||
F.InputFileOffsets.reserve(NumInputs);
|
||||
using namespace llvm::support;
|
||||
const char *Buf = Blob.data();
|
||||
for (unsigned int I = 0; I < NumInputs; ++I)
|
||||
F.InputFileOffsets.push_back(
|
||||
endian::readNext<uint64_t, native, unaligned>(Buf));
|
||||
|
||||
F.InputFileOffsets = (const uint64_t *)Blob.data();
|
||||
F.InputFilesLoaded.resize(NumInputs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue