[dsymutil] Move CommonSymbols.clear() in resetParserState.
authorJonas Devlieghere <jonas@devlieghere.com>
Thu, 10 Oct 2019 16:37:38 +0000 (16:37 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Thu, 10 Oct 2019 16:37:38 +0000 (16:37 +0000)
This seems like a more natural place to clear the vector, especially
since this method is clearing other data structures as well.

llvm-svn: 374378

llvm/tools/dsymutil/MachODebugMapParser.cpp

index 487fbfff50cfac342d1f3b50eddefeb116f9813b..3292e94857250cadc75f21f9cb4b67107286cf56 100644 (file)
@@ -123,6 +123,7 @@ private:
 /// file. This is to be called after an object file is finished
 /// processing.
 void MachODebugMapParser::resetParserState() {
+  CommonSymbols.clear();
   CurrentObjectAddresses.clear();
   CurrentDebugMapObject = nullptr;
 }
@@ -144,7 +145,6 @@ void MachODebugMapParser::addCommonSymbols() {
       continue;
     }
   }
-  CommonSymbols.clear();
 }
 
 /// Create a new DebugMapObject. This function resets the state of the