diff options
Diffstat (limited to 'lib/IR/DebugInfo.cpp')
| -rw-r--r-- | lib/IR/DebugInfo.cpp | 39 | 
1 files changed, 23 insertions, 16 deletions
diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index c5d39c544304..ca3828420a72 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -1,4 +1,4 @@ -//===--- DebugInfo.cpp - Debug Information Helper Classes -----------------===// +//===- DebugInfo.cpp - Debug Information Helper Classes -------------------===//  //  //                     The LLVM Compiler Infrastructure  // @@ -12,22 +12,29 @@  //  //===----------------------------------------------------------------------===// -#include "llvm/IR/DebugInfo.h" -#include "LLVMContextImpl.h" -#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/DenseSet.h" +#include "llvm/ADT/None.h"  #include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/IR/BasicBlock.h"  #include "llvm/IR/Constants.h" -#include "llvm/IR/DIBuilder.h" -#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/DebugInfo.h" +#include "llvm/IR/DebugInfoMetadata.h" +#include "llvm/IR/DebugLoc.h" +#include "llvm/IR/Function.h"  #include "llvm/IR/GVMaterializer.h" -#include "llvm/IR/Instructions.h" +#include "llvm/IR/Instruction.h"  #include "llvm/IR/IntrinsicInst.h" -#include "llvm/IR/Intrinsics.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Metadata.h"  #include "llvm/IR/Module.h" -#include "llvm/IR/ValueHandle.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/Dwarf.h" -#include "llvm/Support/raw_ostream.h" +#include "llvm/Support/Casting.h" +#include <algorithm> +#include <cassert> +#include <utility> +  using namespace llvm;  using namespace llvm::dwarf; @@ -249,7 +256,7 @@ bool DebugInfoFinder::addScope(DIScope *Scope) {    return true;  } -static llvm::MDNode *stripDebugLocFromLoopID(llvm::MDNode *N) { +static MDNode *stripDebugLocFromLoopID(MDNode *N) {    assert(N->op_begin() != N->op_end() && "Missing self reference?");    // if there is no debug location, we do not have to rewrite this MDNode. @@ -288,7 +295,7 @@ bool llvm::stripDebugInfo(Function &F) {      F.setSubprogram(nullptr);    } -  llvm::DenseMap<llvm::MDNode*, llvm::MDNode*> LoopIDsMap; +  DenseMap<MDNode*, MDNode*> LoopIDsMap;    for (BasicBlock &BB : F) {      for (auto II = BB.begin(), End = BB.end(); II != End;) {        Instruction &I = *II++; // We may delete the instruction, increment now. @@ -525,7 +532,7 @@ private:    void traverse(MDNode *);  }; -} // Anonymous namespace. +} // end anonymous namespace  void DebugTypeInfoRemoval::traverse(MDNode *N) {    if (!N || Replacements.count(N)) @@ -590,7 +597,7 @@ bool llvm::stripNonLineTableDebugInfo(Module &M) {      GV.eraseMetadata(LLVMContext::MD_dbg);    DebugTypeInfoRemoval Mapper(M.getContext()); -  auto remap = [&](llvm::MDNode *Node) -> llvm::MDNode * { +  auto remap = [&](MDNode *Node) -> MDNode * {      if (!Node)        return nullptr;      Mapper.traverseAndRemap(Node);  | 
