本文整理汇总了C++中MemoryBufferRef::getBufferEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ MemoryBufferRef::getBufferEnd方法的具体用法?C++ MemoryBufferRef::getBufferEnd怎么用?C++ MemoryBufferRef::getBufferEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemoryBufferRef
的用法示例。
在下文中一共展示了MemoryBufferRef::getBufferEnd方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: error_code
static std::error_code checkOffset(MemoryBufferRef M, uintptr_t Addr,
const uint64_t Size) {
if (Addr + Size < Addr || Addr + Size < Size ||
Addr + Size > uintptr_t(M.getBufferEnd()) ||
Addr < uintptr_t(M.getBufferStart())) {
return object_error::unexpected_eof;
}
return std::error_code();
}
示例2: make_error_code
static std::error_code checkOffset(MemoryBufferRef M, uintptr_t Addr,
const uint64_t Size) {
if (Addr + Size < Addr || Addr + Size < Size ||
Addr + Size > uintptr_t(M.getBufferEnd()) ||
Addr < uintptr_t(M.getBufferStart())) {
return std::make_error_code(std::errc::bad_address);
}
return std::error_code();
}
示例3: checkOffset
static Error checkOffset(MemoryBufferRef M, uintptr_t Addr,
const uint64_t Size) {
if (Addr + Size < Addr || Addr + Size < Size ||
Addr + Size > uintptr_t(M.getBufferEnd()) ||
Addr < uintptr_t(M.getBufferStart())) {
return make_error<RawError>(raw_error_code::corrupt_file,
"Invalid buffer address");
}
return Error::success();
}
示例4: T
std::unique_ptr<Module> llvm::parseIR(MemoryBufferRef Buffer, SMDiagnostic &Err,
LLVMContext &Context) {
NamedRegionTimer T(TimeIRParsingName, TimeIRParsingGroupName,
TimePassesIsEnabled);
if (isBitcode((const unsigned char *)Buffer.getBufferStart(),
(const unsigned char *)Buffer.getBufferEnd())) {
ErrorOr<std::unique_ptr<Module>> ModuleOrErr =
parseBitcodeFile(Buffer, Context);
if (std::error_code EC = ModuleOrErr.getError()) {
Err = SMDiagnostic(Buffer.getBufferIdentifier(), SourceMgr::DK_Error,
EC.message());
return nullptr;
}
return std::move(ModuleOrErr.get());
}
return parseAssembly(Buffer, Err, Context);
}
示例5: InputBuffer
Reader::Reader(MemoryBufferRef InputBuffer)
: InputBuffer(InputBuffer), Current(InputBuffer.getBufferStart()),
End(InputBuffer.getBufferEnd()) {}