diff options
author | Amy Huang <akhuang@google.com> | 2019-04-23 21:12:58 +0000 |
---|---|---|
committer | Amy Huang <akhuang@google.com> | 2019-04-23 21:12:58 +0000 |
commit | fc79ab9857adc96d243cc5ed0a641eef8ef3f253 (patch) | |
tree | 19b9d84f6d3f2f193eccc59cd3318a35ba1ac2f2 | |
parent | 3cc6d1f542b5643a4284d2e43fd656b714c35abd (diff) | |
download | bcm5719-llvm-fc79ab9857adc96d243cc5ed0a641eef8ef3f253.tar.gz bcm5719-llvm-fc79ab9857adc96d243cc5ed0a641eef8ef3f253.zip |
Revert "[MS] Emit S_HEAPALLOCSITE debug info" because of ToTWin64(db)
buildbot failure.
This reverts commit d07d6d617713bececf57f3547434dd52f0f13f9e and
c774f687b6880484a126ed3e3d737e74c926f0ae.
llvm-svn: 359034
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 1 | ||||
-rw-r--r-- | llvm/include/llvm/CodeGen/MachineFunction.h | 12 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 18 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h | 1 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 11 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 6 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/label-heapallocsite.ll | 68 |
7 files changed, 1 insertions, 116 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 2b7653a5a4d..95ec4fa690c 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1969,6 +1969,7 @@ void CGDebugInfo::addHeapAllocSiteMetadata(llvm::Instruction *CI, QualType PointeeTy = D.getTypePtr()->getPointeeType(); node = getOrCreateType(PointeeTy, getOrCreateFile(Loc)); } + CI->setMetadata("heapallocsite", node); } diff --git a/llvm/include/llvm/CodeGen/MachineFunction.h b/llvm/include/llvm/CodeGen/MachineFunction.h index 741ced4c9de..3d07c49cb64 100644 --- a/llvm/include/llvm/CodeGen/MachineFunction.h +++ b/llvm/include/llvm/CodeGen/MachineFunction.h @@ -321,10 +321,6 @@ class MachineFunction { /// CodeView label annotations. std::vector<std::pair<MCSymbol *, MDNode *>> CodeViewAnnotations; - /// CodeView heapallocsites. - std::vector<std::tuple<MCSymbol*, MCSymbol*, DIType*>> - CodeViewHeapAllocSites; - bool CallsEHReturn = false; bool CallsUnwindInit = false; bool HasEHScopes = false; @@ -910,14 +906,6 @@ public: return CodeViewAnnotations; } - /// Record heapallocsites - void addCodeViewHeapAllocSite(MachineInstr *I, MDNode *MD); - - ArrayRef<std::tuple<MCSymbol*, MCSymbol*, DIType*>> - getCodeViewHeapAllocSites() const { - return CodeViewHeapAllocSites; - } - /// Return a reference to the C++ typeinfo for the current function. const std::vector<const GlobalValue *> &getTypeInfos() const { return TypeInfos; diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 8ca30d03bb0..89cd7a8e3bd 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -1072,23 +1072,6 @@ void CodeViewDebug::emitDebugInfoForFunction(const Function *GV, endSymbolRecord(AnnotEnd); } - for (auto HeapAllocSite : FI.HeapAllocSites) { - MCSymbol *BeginLabel = std::get<0>(HeapAllocSite); - MCSymbol *EndLabel = std::get<1>(HeapAllocSite); - DIType *DITy = std::get<2>(HeapAllocSite); - - MCSymbol *HeapAllocEnd = beginSymbolRecord(SymbolKind::S_HEAPALLOCSITE); - OS.AddComment("Call site offset"); - OS.EmitCOFFSecRel32(BeginLabel, /*Offset=*/0); - OS.AddComment("Call site section index"); - OS.EmitCOFFSectionIndex(BeginLabel); - OS.AddComment("Call instruction length"); - OS.emitAbsoluteSymbolDiff(EndLabel, BeginLabel, 2); - OS.AddComment("Type index"); - OS.EmitIntValue(getCompleteTypeIndex(DITy).getIndex(), 4); - endSymbolRecord(HeapAllocEnd); - } - if (SP != nullptr) emitDebugInfoForUDTs(LocalUDTs); @@ -2824,7 +2807,6 @@ void CodeViewDebug::endFunctionImpl(const MachineFunction *MF) { } CurFn->Annotations = MF->getCodeViewAnnotations(); - CurFn->HeapAllocSites = MF->getCodeViewHeapAllocSites(); CurFn->End = Asm->getFunctionEnd(); diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h index 93204036617..35902302c21 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h @@ -147,7 +147,6 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public DebugHandlerBase { SmallVector<LexicalBlock *, 1> ChildBlocks; std::vector<std::pair<MCSymbol *, MDNode *>> Annotations; - std::vector<std::tuple<MCSymbol *, MCSymbol *, DIType *>> HeapAllocSites; const MCSymbol *Begin = nullptr; const MCSymbol *End = nullptr; diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index bcc523f9a2a..88a7d15c299 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -43,7 +43,6 @@ #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constant.h" #include "llvm/IR/DataLayout.h" -#include "llvm/IR/DebugInfoMetadata.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Function.h" #include "llvm/IR/GlobalValue.h" @@ -807,16 +806,6 @@ try_next:; return FilterID; } -void MachineFunction::addCodeViewHeapAllocSite(MachineInstr *I, MDNode *MD) { - MCSymbol *BeginLabel = Ctx.createTempSymbol("heapallocsite", true); - MCSymbol *EndLabel = Ctx.createTempSymbol("heapallocsite", true); - I->setPreInstrSymbol(*this, BeginLabel); - I->setPostInstrSymbol(*this, EndLabel); - - DIType *DI = dyn_cast<DIType>(MD); - CodeViewHeapAllocSites.push_back(std::make_tuple(BeginLabel, EndLabel, DI)); -} - /// \} //===----------------------------------------------------------------------===// diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index fb607bbf739..30294ae1595 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -1234,12 +1234,6 @@ bool FastISel::lowerCallTo(CallLoweringInfo &CLI) { if (CLI.NumResultRegs && CLI.CS) updateValueMap(CLI.CS->getInstruction(), CLI.ResultReg, CLI.NumResultRegs); - // Set labels for heapallocsite call. - if (CLI.CS && CLI.CS->getInstruction()->getMetadata("heapallocsite")) { - MDNode *MD = CLI.CS->getInstruction()->getMetadata("heapallocsite"); - MF->addCodeViewHeapAllocSite(CLI.Call, MD); - } - return true; } diff --git a/llvm/test/CodeGen/X86/label-heapallocsite.ll b/llvm/test/CodeGen/X86/label-heapallocsite.ll deleted file mode 100644 index 56696e0f15a..00000000000 --- a/llvm/test/CodeGen/X86/label-heapallocsite.ll +++ /dev/null @@ -1,68 +0,0 @@ -; RUN: llc -O0 < %s | FileCheck %s -; FIXME: Add test for llc with optimizations once it is implemented. - -; Source to regenerate: -; $ clang --target=x86_64-windows-msvc -S heapallocsite.c -g -gcodeview -o t.ll \ -; -emit-llvm -O0 -Xclang -disable-llvm-passes -fms-extensions -; __declspec(allocator) char *myalloc(); -; void g(); -; void foo() { -; g(); -; myalloc() -; g(); -; } - -target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-windows-msvc" - -; Function Attrs: noinline nounwind optnone -define dso_local void @f() #0 !dbg !7 { -entry: - call void @g(), !dbg !11 - %call = call i8* @myalloc(), !dbg !12, !heapallocsite !13 - call void @g(), !dbg !14 - ret void, !dbg !15 -} - -; CHECK-LABEL: f: # @f -; CHECK: callq g -; CHECK: .Lheapallocsite0: -; CHECK: callq myalloc -; CHECK: .Lheapallocsite1: -; CHECK: retq - -; CHECK-LABEL: .short 4423 # Record kind: S_GPROC32_ID -; CHECK: .short 4446 # Record kind: S_HEAPALLOCSITE -; CHECK-NEXT: .secrel32 .Lheapallocsite0 -; CHECK-NEXT: .secidx .Lheapallocsite0 -; CHECK-NEXT: .short .Lheapallocsite1-.Lheapallocsite0 -; CHECK-NEXT: .long 112 -; CHECK-NEXT: .p2align 2 - -; CHECK-LABEL: .short 4431 # Record kind: S_PROC_ID_END - -declare dso_local void @g() #1 - -declare dso_local i8* @myalloc() #1 - -!llvm.dbg.cu = !{!0} -!llvm.module.flags = !{!3, !4, !5} -!llvm.ident = !{!6} - -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 9.0.0 (https://github.com/llvm/llvm-project.git 4eff3de99423a62fd6e833e29c71c1e62ba6140b)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None) -!1 = !DIFile(filename: "<stdin>", directory: "C:\5Csrc\5Ctest", checksumkind: CSK_MD5, checksum: "6d758cfa3834154a04ce8a55102772a9") -!2 = !{} -!3 = !{i32 2, !"CodeView", i32 1} -!4 = !{i32 2, !"Debug Info Version", i32 3} -!5 = !{i32 1, !"wchar_size", i32 2} -!6 = !{!"clang version 9.0.0 (https://github.com/llvm/llvm-project.git 4eff3de99423a62fd6e833e29c71c1e62ba6140b)"} -!7 = distinct !DISubprogram(name: "f", scope: !8, file: !8, line: 4, type: !9, scopeLine: 4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) -!8 = !DIFile(filename: "heapallocsite.c", directory: "C:\5Csrc\5Ctest", checksumkind: CSK_MD5, checksum: "6d758cfa3834154a04ce8a55102772a9") -!9 = !DISubroutineType(types: !10) -!10 = !{null} -!11 = !DILocation(line: 5, scope: !7) -!12 = !DILocation(line: 6, scope: !7) -!13 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char) -!14 = !DILocation(line: 7, scope: !7) -!15 = !DILocation(line: 8, scope: !7) - |