summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-03-02 17:21:06 +0000
committerAdrian Prantl <aprantl@apple.com>2015-03-02 17:21:06 +0000
commitd50bca7314b94589385a195894caa579d1d9977d (patch)
tree189d163883b5cab0da44b77c4ef1eefb345ae5fe /llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
parent348800b3d9308758f53d4488dbb2bdc8d4475bd4 (diff)
downloadbcm5719-llvm-d50bca7314b94589385a195894caa579d1d9977d.tar.gz
bcm5719-llvm-d50bca7314b94589385a195894caa579d1d9977d.zip
Refactor DebugLocDWARFExpression so it doesn't require access to the
TargetRegisterInfo. DebugLocEntry now holds a buffer with the raw bytes of the pre-calculated DWARF expression. Ought to be NFC, but it does slightly alter the output format of the textual assembly. This reapplies 230930 with a relaxed assertion in DebugLocEntry::finalize() that allows for empty DWARF expressions for constant FP values. llvm-svn: 230975
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
index 6d55c038541..5d2e13f79c0 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
@@ -9,12 +9,14 @@
#ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DEBUGLOCENTRY_H
#define LLVM_LIB_CODEGEN_ASMPRINTER_DEBUGLOCENTRY_H
+#include "llvm/ADT/SmallString.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MachineLocation.h"
namespace llvm {
+class AsmPrinter;
class MDNode;
/// \brief This struct describes location entries emitted in the .debug_loc
/// section.
@@ -84,6 +86,8 @@ private:
/// A nonempty list of locations/constants belonging to this entry,
/// sorted by offset.
SmallVector<Value, 1> Values;
+ SmallString<8> DWARFBytes;
+ SmallVector<std::string, 1> Comments;
public:
DebugLocEntry(const MCSymbol *B, const MCSymbol *E, Value Val)
@@ -146,6 +150,17 @@ public:
}),
Values.end());
}
+
+ void finalize(const AsmPrinter &AP,
+ const DITypeIdentifierMap &TypeIdentifierMap);
+ StringRef getDWARFBytes() const {
+ assert((!DWARFBytes.empty() || Values[0].isConstantFP())
+ && "DebugLocEntry not finalized?");
+ return DWARFBytes;
+ }
+ const SmallVectorImpl<std::string> &getComments() const {
+ return Comments;
+ }
};
/// Compare two Values for equality.
OpenPOWER on IntegriCloud