ClangBuiltLinux / CBL-meetup-2020-slides

Slides from our 2020 meetup
0 stars 0 forks source link

-fno-discard-value-names #9

Open nickdesaulniers opened 4 years ago

nickdesaulniers commented 4 years ago

-fno-discard-value-names is handy when debugging LLVM to keep variable names in the IR rather than numbered identifiers.

nickdesaulniers commented 4 years ago

also, I recently used llvm-extract to pull a function out of a huge piece of IR. It would be helpful to document that.

nickdesaulniers commented 4 years ago

also:

object->print(llvm::errs());

is way better than

#include <string>
std::string out;
llvm::raw_string_ostream RSO(out);
object->print(RSO);
llvm::outs() << out.str();
nickdesaulniers commented 4 years ago

opt -print-module-scope

nickdesaulniers commented 4 years ago

for llc: llc -stop-after=branch-folder -debug-only=branch-folder -print-before=branch-folder -print-after=branch-folder

nickdesaulniers commented 4 years ago

also @gwelymernans mentioned opt -debug-pass=Arguments.

nickdesaulniers commented 4 years ago

how to manually invoke tablegen? how to print passes clang is running? dump() method cvise clean up recommendation of llvm-reduce print-before-all stop-after where to ask for more help

nickdesaulniers commented 4 years ago

-o -: print to stdout rather than write output to file

nickdesaulniers commented 4 years ago

-mllvm -debug-pass=Structure