aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/include/llvm/MC
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/include/llvm/MC')
-rw-r--r--contrib/llvm-project/llvm/include/llvm/MC/MCContext.h6
-rw-r--r--contrib/llvm-project/llvm/include/llvm/MC/MCDwarf.h6
2 files changed, 11 insertions, 1 deletions
diff --git a/contrib/llvm-project/llvm/include/llvm/MC/MCContext.h b/contrib/llvm-project/llvm/include/llvm/MC/MCContext.h
index 61520c4f29bf..c20ce79ee4d0 100644
--- a/contrib/llvm-project/llvm/include/llvm/MC/MCContext.h
+++ b/contrib/llvm-project/llvm/include/llvm/MC/MCContext.h
@@ -190,7 +190,8 @@ private:
SmallString<128> CompilationDir;
/// Prefix replacement map for source file information.
- std::map<const std::string, const std::string> DebugPrefixMap;
+ std::map<std::string, const std::string, std::greater<std::string>>
+ DebugPrefixMap;
/// The main file name if passed in explicitly.
std::string MainFileName;
@@ -698,6 +699,9 @@ public:
/// Add an entry to the debug prefix map.
void addDebugPrefixMapEntry(const std::string &From, const std::string &To);
+ /// Remap one path in-place as per the debug prefix map.
+ void remapDebugPath(SmallVectorImpl<char> &Path);
+
// Remaps all debug directory paths in-place as per the debug prefix map.
void RemapDebugPaths();
diff --git a/contrib/llvm-project/llvm/include/llvm/MC/MCDwarf.h b/contrib/llvm-project/llvm/include/llvm/MC/MCDwarf.h
index 8b2ae84749b4..557c713575e4 100644
--- a/contrib/llvm-project/llvm/include/llvm/MC/MCDwarf.h
+++ b/contrib/llvm-project/llvm/include/llvm/MC/MCDwarf.h
@@ -22,6 +22,7 @@
#include "llvm/MC/StringTableBuilder.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MD5.h"
+#include "llvm/Support/StringSaver.h"
#include <cassert>
#include <cstdint>
#include <string>
@@ -48,6 +49,8 @@ MCSymbol *emitListsTableHeaderStart(MCStreamer &S);
/// Manage the .debug_line_str section contents, if we use it.
class MCDwarfLineStr {
+ BumpPtrAllocator Alloc;
+ StringSaver Saver{Alloc};
MCSymbol *LineStrLabel = nullptr;
StringTableBuilder LineStrings{StringTableBuilder::DWARF};
bool UseRelocs = false;
@@ -57,6 +60,8 @@ public:
/// v5 line table).
explicit MCDwarfLineStr(MCContext &Ctx);
+ StringSaver &getSaver() { return Saver; }
+
/// Emit a reference to the string.
void emitRef(MCStreamer *MCOS, StringRef Path);
@@ -382,6 +387,7 @@ public:
bool hasRootFile() const { return !Header.RootFile.Name.empty(); }
+ MCDwarfFile &getRootFile() { return Header.RootFile; }
const MCDwarfFile &getRootFile() const { return Header.RootFile; }
// Report whether MD5 usage has been consistent (all-or-none).