]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commitdiff
Don't pre-populate the set of keys in the map with variable locations history.
authorAlexey Samsonov <vonosmas@gmail.com>
Tue, 27 May 2014 22:35:00 +0000 (22:35 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Tue, 27 May 2014 22:35:00 +0000 (22:35 +0000)
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

lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index c9bf1ecf9075a87b415596e639acd410b89e6ac9..450d1541384914d731f01688b353fde1a342ae1e 100644 (file)
@@ -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];
 
index 967c7b1b5964228e04983602962e33e1201eb909..dad44b84a153f7b86251bfa17f6d345814d80ee9 100644 (file)
@@ -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();