Boost Users :
Subject: Re: [Boost-users] LLVM bitcode for Boost libraries?
From: degski (degski_at_[hidden])
Date: 2018-11-30 06:03:26
On Thu, 29 Nov 2018 at 18:09, Osman Zakir via Boost-users <
> And what about how to generate LLVM bitcode for Boost libraries? Can I do
> it with the bootstrapper tool that comes with the Boost distribution when
> we download Boost source files?
I'm cross-posting this from the cfe-dev list [I know nothing about this,
just that the questions seem to be the same]
Date: Thu, 29 Nov 2018 09:48:58 +0100
From: Alex Denisov via cfe-dev <cfe-dev_at_[hidden]>
To: David Greene <dag_at_[hidden]>
Cc: "cfe-dev_at_[hidden]" <cfe-dev_at_[hidden]>
Subject: Re: [cfe-dev] Getting LLVM IR from clang
Content-Type: text/plain; charset=us-ascii
There are at least two robust ways to get the Bitcode/IR:
1. LTO. You can enable link-time optimization by adding -flto compiler
flags, in the end all object files (*.o) will in fact be bitcode files.
> file gmock.dir/gmock-gtest-all.cc.o
gmock.dir/gmock-gtest-all.cc.o: LLVM bitcode, wrapper x86_6
2. Embedded bitcode. Clang 3.9 and higher has an option -fembed-bitcode.
When enabled, the resulting executable will contain additional section
You can use this great tool to extract the bitcode from an executable.
Both approaches produce bitcode (binary format), if you need IR
(human-readable format), then you can post-process the bitcode by running
llvm-dis against each bitcode file.
I hope it helps.
> On 28. Nov 2018, at 23:22, David Greene via cfe-dev <
> How do I get the LLVM IR produced by clang? I know that -emit-llvm
> produces IR but it seems to be after processing by LLVM (things are
> optimized out, for example). Is there an "official" way to get the IR
> coming right out of clang's codegen? I can do a hack with -mllvm
> -print-before-all but that's icky.
> cfe-dev mailing list
-- *âIf something cannot go on forever, it will stop" - Herbert Stein*
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net