/usr/include/llvm-3.9/llvm/IR/DebugInfo.h is in llvm-3.9-dev 1:3.9.1-19ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | //===- DebugInfo.h - Debug Information Helpers ------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines a bunch of datatypes that are useful for creating and
// walking debug info in LLVM IR form. They essentially provide wrappers around
// the information in the global variables that's needed when constructing the
// DWARF information.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_IR_DEBUGINFO_H
#define LLVM_IR_DEBUGINFO_H
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Dwarf.h"
#include "llvm/Support/ErrorHandling.h"
#include <iterator>
namespace llvm {
class Module;
class DbgDeclareInst;
class DbgValueInst;
template <typename K, typename V, typename KeyInfoT, typename BucketT>
class DenseMap;
/// \brief Find subprogram that is enclosing this scope.
DISubprogram *getDISubprogram(const MDNode *Scope);
/// \brief Strip debug info in the module if it exists.
///
/// To do this, we remove all calls to the debugger intrinsics and any named
/// metadata for debugging. We also remove debug locations for instructions.
/// Return true if module is modified.
bool StripDebugInfo(Module &M);
bool stripDebugInfo(Function &F);
/// \brief Return Debug Info Metadata Version by checking module flags.
unsigned getDebugMetadataVersionFromModule(const Module &M);
/// \brief Utility to find all debug info in a module.
///
/// DebugInfoFinder tries to list all debug info MDNodes used in a module. To
/// list debug info MDNodes used by an instruction, DebugInfoFinder uses
/// processDeclare, processValue and processLocation to handle DbgDeclareInst,
/// DbgValueInst and DbgLoc attached to instructions. processModule will go
/// through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes
/// used by the CUs.
class DebugInfoFinder {
public:
/// \brief Process entire module and collect debug info anchors.
void processModule(const Module &M);
/// \brief Process DbgDeclareInst.
void processDeclare(const Module &M, const DbgDeclareInst *DDI);
/// \brief Process DbgValueInst.
void processValue(const Module &M, const DbgValueInst *DVI);
/// \brief Process debug info location.
void processLocation(const Module &M, const DILocation *Loc);
/// \brief Clear all lists.
void reset();
private:
void InitializeTypeMap(const Module &M);
void processType(DIType *DT);
void processSubprogram(DISubprogram *SP);
void processScope(DIScope *Scope);
bool addCompileUnit(DICompileUnit *CU);
bool addGlobalVariable(DIGlobalVariable *DIG);
bool addSubprogram(DISubprogram *SP);
bool addType(DIType *DT);
bool addScope(DIScope *Scope);
public:
typedef SmallVectorImpl<DICompileUnit *>::const_iterator
compile_unit_iterator;
typedef SmallVectorImpl<DISubprogram *>::const_iterator subprogram_iterator;
typedef SmallVectorImpl<DIGlobalVariable *>::const_iterator
global_variable_iterator;
typedef SmallVectorImpl<DIType *>::const_iterator type_iterator;
typedef SmallVectorImpl<DIScope *>::const_iterator scope_iterator;
iterator_range<compile_unit_iterator> compile_units() const {
return make_range(CUs.begin(), CUs.end());
}
iterator_range<subprogram_iterator> subprograms() const {
return make_range(SPs.begin(), SPs.end());
}
iterator_range<global_variable_iterator> global_variables() const {
return make_range(GVs.begin(), GVs.end());
}
iterator_range<type_iterator> types() const {
return make_range(TYs.begin(), TYs.end());
}
iterator_range<scope_iterator> scopes() const {
return make_range(Scopes.begin(), Scopes.end());
}
unsigned compile_unit_count() const { return CUs.size(); }
unsigned global_variable_count() const { return GVs.size(); }
unsigned subprogram_count() const { return SPs.size(); }
unsigned type_count() const { return TYs.size(); }
unsigned scope_count() const { return Scopes.size(); }
private:
SmallVector<DICompileUnit *, 8> CUs;
SmallVector<DISubprogram *, 8> SPs;
SmallVector<DIGlobalVariable *, 8> GVs;
SmallVector<DIType *, 8> TYs;
SmallVector<DIScope *, 8> Scopes;
SmallPtrSet<const MDNode *, 32> NodesSeen;
};
} // end namespace llvm
#endif
|