Last active
June 8, 2022 07:43
-
-
Save SimeonEhrig/92689b6a5745d7a7013777e61c0a3f6a to your computer and use it in GitHub Desktop.
C++ code to view LLVM IR code of a statement in cling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cling/Interpreter/Interpreter.h" | |
#include "cling/Interpreter/Transaction.h" | |
#include "llvm/IR/Function.h" | |
#include "llvm/IR/Module.h" | |
#include "llvm/Support/raw_ostream.h" | |
auto T1 = gCling->getLatestTransaction(); | |
// command | |
T1->getNext()->dumpPretty(); | |
T1->getNext()->getModule()->print(llvm::outs(), nullptr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since the LLVM 13 update (version 1.0), the code needs a change: