Go to the documentation of this file.
29 class ModuleDebugInfoLegacyPrinter :
public ModulePass {
39 bool runOnModule(
Module &M)
override;
50 "Decodes module-level debug info",
false,
true)
53 return new ModuleDebugInfoLegacyPrinter();
56 bool ModuleDebugInfoLegacyPrinter::runOnModule(
Module &M) {
67 if (!Directory.
empty())
68 O << Directory <<
"/";
80 O <<
"Compile unit: ";
85 O <<
"unknown-language(" <<
CU->getSourceLanguage() <<
")";
91 O <<
"Subprogram: " <<
S->getName();
92 printFile(
O,
S->getFilename(),
S->getDirectory(),
S->getLine());
93 if (!
S->getLinkageName().empty())
94 O <<
" ('" <<
S->getLinkageName() <<
"')";
99 const auto *GV = GVU->getVariable();
100 O <<
"Global variable: " << GV->getName();
101 printFile(
O, GV->getFilename(), GV->getDirectory(), GV->getLine());
102 if (!GV->getLinkageName().empty())
103 O <<
" ('" << GV->getLinkageName() <<
"')";
109 if (!
T->getName().empty())
110 O <<
' ' <<
T->getName();
111 printFile(
O,
T->getFilename(),
T->getDirectory(),
T->getLine());
112 if (
auto *
BT = dyn_cast<DIBasicType>(
T)) {
115 if (!Encoding.empty())
118 O <<
"unknown-encoding(" <<
BT->getEncoding() <<
')';
125 O <<
"unknown-tag(" <<
T->getTag() <<
")";
127 if (
auto *CT = dyn_cast<DICompositeType>(
T)) {
128 if (
auto *
S = CT->getRawIdentifier())
129 O <<
" (identifier: '" <<
S->getString() <<
"')";
A set of analyses that are preserved following a run of a transformation pass.
StringRef AttributeEncodingString(unsigned Encoding)
static void printFile(raw_ostream &O, StringRef Filename, StringRef Directory, unsigned Line=0)
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
iterator_range< compile_unit_iterator > compile_units() const
Utility to find all debug info in a module.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
StringRef LanguageString(unsigned Language)
Represent the analysis usage information of a pass.
This class implements an extremely fast bulk output stream that can only output to a stream.
static void printModuleDebugInfo(raw_ostream &O, const Module *M, const DebugInfoFinder &Finder)
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
void initializeModuleDebugInfoLegacyPrinterPass(PassRegistry &)
constexpr LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
ModulePass * createModuleDebugInfoPrinterPass()
void processModule(const Module &M)
Process entire module and collect debug info anchors.
A Module instance is used to store all the information related to an LLVM module.
iterator_range< global_variable_expression_iterator > global_variables() const
iterator_range< subprogram_iterator > subprograms() const
StringRef - Represent a constant reference to a string, i.e.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
INITIALIZE_PASS(ModuleDebugInfoLegacyPrinter, "module-debuginfo", "Decodes module-level debug info", false, true) ModulePass *llvm
void setPreservesAll()
Set by analyses that do not transform their input at all.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
A container for analyses that lazily runs them and caches their results.
StringRef TagString(unsigned Tag)
iterator_range< type_iterator > types() const
ModuleDebugInfoPrinterPass(raw_ostream &OS)