[llvm-dev] Migration from 3.8 to 6.0 questions (segfault most concerning)
edA-qa mort-ora-y via llvm-dev
llvm-dev at lists.llvm.org
Fri Mar 16 23:57:52 PDT 2018
I found the problem with `getOrInsertFunction`. It's now using a C++
variadic template, thus I shouldn't provide the trailing null sentry.
Changing to this works:
module->getOrInsertFunction("count_malloc", generic_ptr,
f_natural_int );
It looks like LLVM is being slowly C++ modernized, I do the same in my
code over time. :)
On 17/03/18 07:48, edA-qa mort-ora-y via llvm-dev wrote:
>
> I'm encountering a few problems in my migration that I haven't yet
> figured out.
>
> `getOrInsertFunction` is generating a SEGFAULT at
> FunctionType::isValidArgumentType(llvm::Type*). I'm calling it as:
>
> generic_ptr_ = llvm::PointerType::get(
> llvm::Type::getInt8Ty(context), 0 );
> f_natural_int = llvm::IntegerType::get(context, 64);
> module->getOrInsertFunction(
> "count_malloc", generic_ptr, f_natural_int, (llvm::Type*)0 );
>
>
> It appears there is no more Reloc::Default or CodeModel::Default, but
> the docs on those fields indicate there is still a target default. How
> do I get the default relocation and codeModel?
>
> I'm still using the legacy::PassManager. Is there a new way to do the
> passes now?
>
> There docs still reference `tool_output_file*`*, but it appears the
> new name, in the header, is `ToolOutputFile`.
> https://llvm.org/doxygen/classllvm_1_1tool__output__file.html
>
> --
> edA-qa mort-ora-y
> http://mortoray.com/
>
> Creator of the Leaf language
> http://leaflang.org/
>
> Streaming algorithms, AI, and design on Twitch
> https://www.twitch.tv/mortoray
>
> Twitter
> edaqa
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
--
edA-qa mort-ora-y
http://mortoray.com/
Creator of the Leaf language
http://leaflang.org/
Streaming algorithms, AI, and design on Twitch
https://www.twitch.tv/mortoray
Twitter
edaqa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180317/e3180fb5/attachment.html>
More information about the llvm-dev
mailing list