SelectionDAG: Use InsertNode for EntryNode
authorMatthias Braun <matze@braunis.de>
Mon, 21 Sep 2015 17:41:05 +0000 (17:41 +0000)
committerMatthias Braun <matze@braunis.de>
Mon, 21 Sep 2015 17:41:05 +0000 (17:41 +0000)
This fixes problems where two nodes have persistent debug id 0 assigned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248182 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index e2e34dbf07ad69c8d462fe0dfa7e2021d9aed775..2aec9050d9720c6491318b3b810177f7cf863fe1 100644 (file)
@@ -927,7 +927,7 @@ SelectionDAG::SelectionDAG(const TargetMachine &tm, CodeGenOpt::Level OL)
       EntryNode(ISD::EntryToken, 0, DebugLoc(), getVTList(MVT::Other)),
       Root(getEntryNode()), NewNodesMustHaveLegalTypes(false),
       UpdateListeners(nullptr) {
       EntryNode(ISD::EntryToken, 0, DebugLoc(), getVTList(MVT::Other)),
       Root(getEntryNode()), NewNodesMustHaveLegalTypes(false),
       UpdateListeners(nullptr) {
-  AllNodes.push_back(&EntryNode);
+  InsertNode(&EntryNode);
   DbgInfo = new SDDbgInfo();
 }
 
   DbgInfo = new SDDbgInfo();
 }
 
@@ -1024,7 +1024,7 @@ void SelectionDAG::clear() {
             static_cast<SDNode*>(nullptr));
 
   EntryNode.UseList = nullptr;
             static_cast<SDNode*>(nullptr));
 
   EntryNode.UseList = nullptr;
-  AllNodes.push_back(&EntryNode);
+  InsertNode(&EntryNode);
   Root = getEntryNode();
   DbgInfo->clear();
 }
   Root = getEntryNode();
   DbgInfo->clear();
 }