summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-05-27 22:35:00 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-05-27 22:35:00 +0000
commit50adf380805c0c239be0e3806b568f1af8cdff45 (patch)
tree51f0fecd57dc3a8acf5ceb932cdefe560a18ff2a /lib/CodeGen/AsmPrinter
parent08f32401a95e27ca19ce6747105aa8d2a721ba7a (diff)
downloadllvm-50adf380805c0c239be0e3806b568f1af8cdff45.tar.gz
llvm-50adf380805c0c239be0e3806b568f1af8cdff45.tar.bz2
llvm-50adf380805c0c239be0e3806b568f1af8cdff45.tar.xz
Don't pre-populate the set of keys in the map with variable locations history.
Current implementation of calculateDbgValueHistory already creates the keys in the expected order (user variables are listed in order of appearance), and should do so later by contract. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209690 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter')
-rw-r--r--lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp1
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp13
2 files changed, 3 insertions, 11 deletions
diff --git a/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp b/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
index c9bf1ecf90..450d154138 100644
--- a/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
+++ b/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
@@ -144,6 +144,7 @@ void calculateDbgValueHistory(const MachineFunction *MF,
continue;
}
+ assert(MI.getNumOperands() > 1 && "Invalid DBG_VALUE instruction!");
const MDNode *Var = MI.getDebugVariable();
auto &History = Result[Var];
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 967c7b1b59..dad44b84a1 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1404,17 +1404,8 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
// Collect user variables, find the end of the prologue.
for (const auto &MBB : *MF) {
for (const auto &MI : MBB) {
- if (MI.isDebugValue()) {
- assert(MI.getNumOperands() > 1 && "Invalid machine instruction!");
- // Keep track of user variables in order of appearance. Create the
- // empty history for each variable so that the order of keys in
- // DbgValues is correct. Actual history will be populated in
- // calculateDbgValueHistory() function.
- const MDNode *Var = MI.getDebugVariable();
- DbgValues.insert(
- std::make_pair(Var, SmallVector<const MachineInstr *, 4>()));
- } else if (!MI.getFlag(MachineInstr::FrameSetup) &&
- PrologEndLoc.isUnknown() && !MI.getDebugLoc().isUnknown()) {
+ if (!MI.isDebugValue() && !MI.getFlag(MachineInstr::FrameSetup) &&
+ PrologEndLoc.isUnknown() && !MI.getDebugLoc().isUnknown()) {
// First known non-DBG_VALUE and non-frame setup location marks
// the beginning of the function body.
PrologEndLoc = MI.getDebugLoc();