本文整理汇总了C++中OutputFile::dup方法的典型用法代码示例。如果您正苦于以下问题:C++ OutputFile::dup方法的具体用法?C++ OutputFile::dup怎么用?C++ OutputFile::dup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputFile
的用法示例。
在下文中一共展示了OutputFile::dup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compile
enum Compiler::ErrorCode Compiler::compile(Script &pScript,
OutputFile &pResult,
llvm::raw_ostream *IRStream) {
// Check the state of the specified output file.
if (pResult.hasError()) {
return kErrInvalidOutputFileState;
}
// Open the output file decorated in llvm::raw_ostream.
llvm::raw_pwrite_stream *out = pResult.dup();
if (out == nullptr) {
return kErrPrepareOutput;
}
// Delegate the request.
enum Compiler::ErrorCode err = compile(pScript, *out, IRStream);
// Close the output before return.
delete out;
return err;
}
示例2: Disassemble
DisassembleResult Disassemble(OutputFile &pOutput, const char *pTriple,
const char *pFuncName, const uint8_t *pFunc,
size_t FuncSize) {
// Check the state of the specified output file.
if (pOutput.hasError()) {
return kDisassembleInvalidOutput;
}
// Open the output file decorated in llvm::raw_ostream.
llvm::raw_ostream *output = pOutput.dup();
if (output == NULL) {
return kDisassembleFailedPrepareOutput;
}
// Delegate the request.
DisassembleResult result =
Disassemble(*output, pTriple, pFuncName, pFunc, FuncSize);
// Close the output before return.
delete output;
return result;
}