summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DIE.h
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2013-07-02 18:46:26 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2013-07-02 18:46:26 +0000
commit1f8aacd6afdc30b4d1cf1da3bf5e41c7874f89be (patch)
tree6e197638122f16d7445e798897524d1230e6661e /lib/CodeGen/AsmPrinter/DIE.h
parent88328d2ff47670314a1007a4c81c42adf026ee9f (diff)
downloadllvm-1f8aacd6afdc30b4d1cf1da3bf5e41c7874f89be.tar.gz
llvm-1f8aacd6afdc30b4d1cf1da3bf5e41c7874f89be.tar.bz2
llvm-1f8aacd6afdc30b4d1cf1da3bf5e41c7874f89be.tar.xz
[DebugInfo] Introduce DIEExpr variant of DIEValue to hold MCExpr values
This partially reverts r185202 and restores DIELabel to hold plain MCSymbol references. Instead, we add a new subclass DIEExpr of DIEValue that can hold generic MCExpr references. This is in preparation for supporting debug info for TLS variables on PowerPC, where we need to describe the variable location using a more complex expression than just MCSymbolRefExpr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185458 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DIE.h')
-rw-r--r--lib/CodeGen/AsmPrinter/DIE.h39
1 files changed, 33 insertions, 6 deletions
diff --git a/lib/CodeGen/AsmPrinter/DIE.h b/lib/CodeGen/AsmPrinter/DIE.h
index eaa61d925e..412c09c6c8 100644
--- a/lib/CodeGen/AsmPrinter/DIE.h
+++ b/lib/CodeGen/AsmPrinter/DIE.h
@@ -190,6 +190,7 @@ namespace llvm {
enum {
isInteger,
isString,
+ isExpr,
isLabel,
isDelta,
isEntry,
@@ -263,14 +264,40 @@ namespace llvm {
};
//===--------------------------------------------------------------------===//
- /// DIELabel - A label expression DIE.
+ /// DIEExpr - An expression DIE.
+ //
+ class DIEExpr : public DIEValue {
+ const MCExpr *Expr;
+ public:
+ explicit DIEExpr(const MCExpr *E) : DIEValue(isExpr), Expr(E) {}
+
+ /// EmitValue - Emit expression value.
+ ///
+ virtual void EmitValue(AsmPrinter *AP, unsigned Form) const;
+
+ /// getValue - Get MCExpr.
+ ///
+ const MCExpr *getValue() const { return Expr; }
+
+ /// SizeOf - Determine size of expression value in bytes.
+ ///
+ virtual unsigned SizeOf(AsmPrinter *AP, unsigned Form) const;
+
+ // Implement isa/cast/dyncast.
+ static bool classof(const DIEValue *E) { return E->getType() == isExpr; }
+
+#ifndef NDEBUG
+ virtual void print(raw_ostream &O) const;
+#endif
+ };
+
+ //===--------------------------------------------------------------------===//
+ /// DIELabel - A label DIE.
//
class DIELabel : public DIEValue {
- const MCSymbolRefExpr *Label;
+ const MCSymbol *Label;
public:
- explicit DIELabel(const MCSymbolRefExpr *L) : DIEValue(isLabel), Label(L) {}
- explicit DIELabel(const MCSymbol *Sym, MCContext &Ctxt)
- : DIEValue(isLabel), Label(MCSymbolRefExpr::Create(Sym, Ctxt)) {}
+ explicit DIELabel(const MCSymbol *L) : DIEValue(isLabel), Label(L) {}
/// EmitValue - Emit label value.
///
@@ -278,7 +305,7 @@ namespace llvm {
/// getValue - Get MCSymbol.
///
- const MCSymbolRefExpr *getValue() const { return Label; }
+ const MCSymbol *getValue() const { return Label; }
/// SizeOf - Determine size of label value in bytes.
///