Revert "[MC] Make .pseudo_probe sections deterministic after D91878"

This reverts commit c8fd0cf713.

Caused heap-use-after-free
This commit is contained in:
Fangrui Song 2023-09-20 16:36:23 -07:00
parent c03d18441c
commit 2be94d18b5

View File

@ -55,7 +55,6 @@
#define LLVM_MC_MCPSEUDOPROBE_H
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/IR/PseudoProbe.h"
@ -300,7 +299,8 @@ public:
MCProbeDivisions[FuncSym].addPseudoProbe(Probe, InlineStack);
}
using MCProbeDivisionMap = MapVector<MCSymbol *, MCPseudoProbeInlineTree>;
// TODO: Sort by getOrdinal to ensure a determinstic section order
using MCProbeDivisionMap = std::map<MCSymbol *, MCPseudoProbeInlineTree>;
private:
// A collection of MCPseudoProbe for each function. The MCPseudoProbes are