Skip to content

Commit 6ae946a

Browse files
committed
Remove ToString() call on module
Signed-off-by: Vihan <vihan+github@vihan.org>
1 parent d734f57 commit 6ae946a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ir/module.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ NAN_METHOD(ModuleWrapper::New) {
4747
return Nan::ThrowTypeError("The Module functionTemplate needs to be called with: (moduleId: string, context: LLVMContext)");
4848
}
4949

50-
auto moduleId = ToString(info[0]->ToString());
50+
auto moduleId = ToString(info[0]);
5151
auto* llvmContextWrapper = LLVMContextWrapper::FromValue(info[1]);
5252

5353
auto* moduleWrapper = new ModuleWrapper { llvm::StringRef { moduleId.c_str(), moduleId.length() },
@@ -98,12 +98,12 @@ NAN_METHOD(ModuleWrapper::getOrInsertFunction) {
9898
#if LLVM_VERSION_MAJOR < 9
9999
Nan::Set(functionCallee, Nan::New("callee").ToLocalChecked(), ConstantWrapper::of(module->getOrInsertFunction(name, fnType)));
100100
Nan::Set(functionCallee, Nan::New("functionType").ToLocalChecked(), FunctionTypeWrapper::of(fnType));
101-
#else
101+
#else
102102
auto llvmCallee = module->getOrInsertFunction(name, fnType);
103103
Nan::Set(functionCallee, Nan::New("callee").ToLocalChecked(), ValueWrapper::of(llvmCallee.getCallee()));
104104
Nan::Set(functionCallee, Nan::New("functionType").ToLocalChecked(), FunctionTypeWrapper::of(llvmCallee.getFunctionType()));
105105
#endif
106-
106+
107107
Nan::EscapableHandleScope scope {};
108108
info.GetReturnValue().Set(scope.Escape(functionCallee));
109109
}

0 commit comments

Comments
 (0)