[LLVMdev] Possible change to ExecutionEngine::create()

Rob Grapes Rob.Grapes at ur.co.nz
Wed Jul 22 21:43:15 PDT 2009


Hi,

Would it be possible to make the following slight change to ExecutionEngine::create()?

I would like to be able to disable the automatic enumeration of loaded modules, and the subsequent searching for undefined symbols (using SearchForAddressOfSymbol).

I propose adding an extra parameter to the function definition, defaulting to true.

  static ExecutionEngine *create(ModuleProvider *MP,
                                 bool ForceInterpreter = false,
                                 std::string *ErrorStr = 0,
                                 bool Fast = false,
                                 bool EnumModules = true);

And corresponding change to the function.

ExecutionEngine *ExecutionEngine::create(ModuleProvider *MP,
                                         bool ForceInterpreter,
                                         std::string *ErrorStr,
                                         bool Fast,
                                         bool EnumModules) {
  ExecutionEngine *EE = 0;
  if (EnumModules) {
    // Make sure we can resolve symbols in the program as well. The zero arg
    // to the function tells DynamicLibrary to load the program, not a library.
    if (sys::DynamicLibrary::LoadLibraryPermanently(0, ErrorStr))
      return 0;
  }
  ...

Your help would be appreciated.

Rob.




More information about the llvm-dev mailing list