2012-08-02 44 views
1

我正在写我自己的LLVM pass,它修改LLVM位代码。在生成位代码时,我想禁用函数内联,但是当我修改位代码时,我想调用执行函数内联的函数。这可以做到吗?如果是,如何?你能从LLVM传球中传球吗?

为了更好地理解,我在说什么,看下面的代码。

bool MyBitCodeModifier::runOnModule(Module &M) 
{ 
    // Here is the code of my pass which modifies bitcode 
    // I need to call inline pass here 
} 
+0

你不能从函数MyBitCodeModifier :: runOnModule返回的地方调用inline-pass。 – 2012-08-04 18:39:23

回答

1

对于内联,您不需要调用通行证。改为使用InlineFunction。你可以在include/llvm/Transforms/Utils/Cloning.h找到定义。

但是,如果您坚持在您的电话后面插入通行证,您可以修改PassManager以按您的要求运行通行证。