nagisa / llvm_build_utils.rs

LLVM build utils for cargo build scripts
2 stars 0 forks source link

can we have a simple tutorial? #3

Open llogiq opened 7 years ago

llogiq commented 7 years ago

For example, it should be easy enough to build test::black_box with this, right?

nagisa commented 7 years ago

No, sadly you cannot implement equivalent for black_box without inline assembly. While there are many ways to implement a function which inhibits optimisations for a value, only the implementation with inline assembly is able to compile down to literally nothing.

nagisa commented 7 years ago

As for the tutorials, there’s number of examples in the tests directory. That being said, I don’t recommend using this crate yet.