本文整理汇总了C++中rc::ConstHandle::llvmDispose方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstHandle::llvmDispose方法的具体用法?C++ ConstHandle::llvmDispose怎么用?C++ ConstHandle::llvmDispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rc::ConstHandle
的用法示例。
在下文中一共展示了ConstHandle::llvmDispose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: llvmThrowOutOfRangeException
//.........这里部分代码省略.........
errorDescConstStringRValue->addIncoming( haveErrorDescConstStringRValue, haveErrorDescBB );
errorDescConstStringRValue->addIncoming( noErrorDescConstStringRValue, noErrorDescBB );
llvm::Value *errorMsg0RValue = stringAdapter->llvmCast(
subBasicBlockBuilder,
ExprValue( constStringAdapter, USAGE_RVALUE, context, errorDescConstStringRValue )
);
llvm::Value *errorMsgARValue = stringAdapter->llvmCast( subBasicBlockBuilder,
ExprValue( constStringAdapter, USAGE_RVALUE, context, constStringAdapter->llvmConst( subBasicBlockBuilder, ": " ) )
);
llvm::Value *errorMsgALValue = stringAdapter->llvmAlloca( subBasicBlockBuilder, "errorMsgA" );
stringAdapter->llvmInit( subBasicBlockBuilder, errorMsgALValue );
stringAdapter->llvmCallConcat(
subBasicBlockBuilder,
errorMsg0RValue,
errorMsgARValue,
errorMsgALValue
);
llvm::Value *errorMsgBRValue = stringAdapter->llvmCast( subBasicBlockBuilder,
ExprValue( constStringAdapter, USAGE_RVALUE, context, itemRValue )
);
llvm::Value *errorMsgBLValue = stringAdapter->llvmAlloca( subBasicBlockBuilder, "errorMsgB" );
stringAdapter->llvmInit( subBasicBlockBuilder, errorMsgBLValue );
stringAdapter->llvmCallConcat(
subBasicBlockBuilder,
stringAdapter->llvmLValueToRValue( subBasicBlockBuilder, errorMsgALValue ),
errorMsgBRValue,
errorMsgBLValue
);
stringAdapter->llvmDispose( subBasicBlockBuilder, errorMsgALValue );
llvm::Value *errorMsgCRValue = stringAdapter->llvmCast( subBasicBlockBuilder,
ExprValue( constStringAdapter, USAGE_RVALUE, context, constStringAdapter->llvmConst( subBasicBlockBuilder, " (" ) )
);
llvm::Value *errorMsgCLValue = stringAdapter->llvmAlloca( subBasicBlockBuilder, "errorMsgC" );
stringAdapter->llvmInit( subBasicBlockBuilder, errorMsgCLValue );
stringAdapter->llvmCallConcat(
subBasicBlockBuilder,
stringAdapter->llvmLValueToRValue( subBasicBlockBuilder, errorMsgBLValue ),
errorMsgCRValue,
errorMsgCLValue
);
stringAdapter->llvmDispose( subBasicBlockBuilder, errorMsgBLValue );
llvm::Value *indexStringRValue = stringAdapter->llvmCast(
subBasicBlockBuilder,
ExprValue( sizeAdapter, USAGE_RVALUE, context, indexRValue )
);
llvm::Value *errorMsg1PlusIndexLValue = stringAdapter->llvmAlloca( subBasicBlockBuilder, "errorMsg1PlusIndex" );
stringAdapter->llvmInit( subBasicBlockBuilder, errorMsg1PlusIndexLValue );
stringAdapter->llvmCallConcat(
subBasicBlockBuilder,
stringAdapter->llvmLValueToRValue( subBasicBlockBuilder, errorMsgCLValue ),
indexStringRValue,
errorMsg1PlusIndexLValue
);
stringAdapter->llvmDispose( subBasicBlockBuilder, errorMsgCLValue );
llvm::Value *errorMsg2RValue = stringAdapter->llvmCast(
subBasicBlockBuilder,
示例2: llvmCompileToModule
void ArrayProducerAdapter::llvmCompileToModule( ModuleBuilder &moduleBuilder ) const
{
if ( moduleBuilder.haveCompiledToModule( getCodeName() ) )
return;
RC::Handle<Context> context = moduleBuilder.getContext();
m_elementAdapter->llvmCompileToModule( moduleBuilder );
m_elementVariableArrayAdapter->llvmCompileToModule( moduleBuilder );
RC::ConstHandle<BooleanAdapter> booleanAdapter = getManager()->getBooleanAdapter();
booleanAdapter->llvmCompileToModule( moduleBuilder );
RC::ConstHandle<SizeAdapter> sizeAdapter = getManager()->getSizeAdapter();
sizeAdapter->llvmCompileToModule( moduleBuilder );
RC::ConstHandle<StringAdapter> stringAdapter = getManager()->getStringAdapter();
stringAdapter->llvmCompileToModule( moduleBuilder );
RC::ConstHandle<ConstStringAdapter> constStringAdapter = getManager()->getConstStringAdapter();
constStringAdapter->llvmCompileToModule( moduleBuilder );
static const bool buildFunctions = true;
{
ConstructorBuilder functionBuilder( moduleBuilder, stringAdapter, this, ConstructorBuilder::HighCost );
if ( buildFunctions )
{
llvm::Value *stringLValue = functionBuilder[0];
BasicBlockBuilder basicBlockBuilder( functionBuilder );
basicBlockBuilder->SetInsertPoint( functionBuilder.createBasicBlock( "entry" ) );
std::string name = getUserName();
ExprValue exprValue( constStringAdapter, USAGE_RVALUE, context, constStringAdapter->llvmConst( basicBlockBuilder, name.data(), name.length() ) );
llvm::Value *stringRValue = stringAdapter->llvmCast( basicBlockBuilder, exprValue );
stringAdapter->llvmAssign( basicBlockBuilder, stringLValue, stringRValue );
stringAdapter->llvmDispose( basicBlockBuilder, stringRValue );
basicBlockBuilder->CreateRetVoid();
}
}
{
ConstructorBuilder functionBuilder( moduleBuilder, booleanAdapter, this, ConstructorBuilder::HighCost );
if ( buildFunctions )
{
llvm::Value *booleanLValue = functionBuilder[0];
llvm::Value *rValue = functionBuilder[1];
BasicBlockBuilder basicBlockBuilder( functionBuilder );
basicBlockBuilder->SetInsertPoint( functionBuilder.createBasicBlock( "entry" ) );
llvm::Value *arrayProducerRValue = basicBlockBuilder->CreateLoad( rValue );
basicBlockBuilder->CreateStore(
basicBlockBuilder->CreateIsNotNull( arrayProducerRValue ),
booleanLValue
);
basicBlockBuilder->CreateRetVoid();
}
}
{
MethodBuilder functionBuilder( moduleBuilder, sizeAdapter, this, USAGE_RVALUE, "getCount" );
if ( buildFunctions )
{
BasicBlockBuilder basicBlockBuilder( functionBuilder );
llvm::Value *rValue = functionBuilder[0];
llvm::BasicBlock *entryBB = basicBlockBuilder.getFunctionBuilder().createBasicBlock( "entry" );
basicBlockBuilder->SetInsertPoint( entryBB );
basicBlockBuilder->CreateRet(
llvmGetCount( basicBlockBuilder, rValue )
);
}
}
{
MethodBuilder functionBuilder(
moduleBuilder,
m_elementVariableArrayAdapter,
this, USAGE_RVALUE,
"produce"
);
if ( buildFunctions )
{
BasicBlockBuilder basicBlockBuilder( functionBuilder );
llvm::Value *rValue = functionBuilder[0];
llvm::BasicBlock *entryBB = basicBlockBuilder.getFunctionBuilder().createBasicBlock( "entry" );
basicBlockBuilder->SetInsertPoint( entryBB );
llvmProduce0( basicBlockBuilder, rValue, functionBuilder.getScope().llvmGetReturnLValue() );
basicBlockBuilder->CreateRetVoid();
}
}
{
MethodBuilder functionBuilder(
moduleBuilder, m_elementAdapter,
this, USAGE_RVALUE,
"produce",
"index", sizeAdapter, USAGE_RVALUE
);
if ( buildFunctions )
//.........这里部分代码省略.........