aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2013-07-02 18:46:46 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2013-07-02 18:46:46 +0000
commit18dbe5029f36a5a5d583295daa4ef6d6f5474c25 (patch)
treec61364a56334a8fd2c5704ce5fd464d526f97793 /lib/CodeGen
parent1f8aacd6afdc30b4d1cf1da3bf5e41c7874f89be (diff)
downloadexternal_llvm-18dbe5029f36a5a5d583295daa4ef6d6f5474c25.zip
external_llvm-18dbe5029f36a5a5d583295daa4ef6d6f5474c25.tar.gz
external_llvm-18dbe5029f36a5a5d583295daa4ef6d6f5474c25.tar.bz2
[DebugInfo] Hold generic MCExpr in AddrPool
This changes the AddrPool infrastructure to enable it to hold generic MCExpr expressions, not just MCSymbolRefExpr. 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@185459 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp14
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h4
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 7195709..40bfaaa 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -251,8 +251,8 @@ unsigned DwarfUnits::getAddrPoolIndex(const MCSymbol *Sym) {
return getAddrPoolIndex(MCSymbolRefExpr::Create(Sym, Asm->OutContext));
}
-unsigned DwarfUnits::getAddrPoolIndex(const MCSymbolRefExpr *Sym) {
- std::pair<DenseMap<const MCSymbolRefExpr *, unsigned>::iterator, bool> P =
+unsigned DwarfUnits::getAddrPoolIndex(const MCExpr *Sym) {
+ std::pair<DenseMap<const MCExpr *, unsigned>::iterator, bool> P =
AddressPool.insert(std::make_pair(Sym, NextAddrPoolNumber));
if (P.second)
++NextAddrPoolNumber;
@@ -2361,9 +2361,9 @@ void DwarfUnits::emitAddresses(const MCSection *AddrSection) {
// Get all of the address pool entries and put them in an array by their ID so
// we can sort them.
- SmallVector<std::pair<unsigned, const MCSymbolRefExpr *>, 64> Entries;
+ SmallVector<std::pair<unsigned, const MCExpr *>, 64> Entries;
- for (DenseMap<const MCSymbolRefExpr *, unsigned>::iterator
+ for (DenseMap<const MCExpr *, unsigned>::iterator
I = AddressPool.begin(),
E = AddressPool.end();
I != E; ++I)
@@ -2372,9 +2372,9 @@ void DwarfUnits::emitAddresses(const MCSection *AddrSection) {
array_pod_sort(Entries.begin(), Entries.end());
for (unsigned i = 0, e = Entries.size(); i != e; ++i) {
- // Emit a label for reference from debug information entries.
- if (const MCSymbolRefExpr *Sym = Entries[i].second)
- Asm->OutStreamer.EmitValue(Sym, Asm->getDataLayout().getPointerSize());
+ // Emit an expression for reference from debug information entries.
+ if (const MCExpr *Expr = Entries[i].second)
+ Asm->OutStreamer.EmitValue(Expr, Asm->getDataLayout().getPointerSize());
else
Asm->OutStreamer.EmitIntValue(0, Asm->getDataLayout().getPointerSize());
}
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 893505c..60c6c3f 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -197,7 +197,7 @@ typedef StringMap<std::pair<MCSymbol*, unsigned>,
// A Symbol->unsigned mapping of addresses used by indirect
// references.
-typedef DenseMap<const MCSymbolRefExpr *, unsigned> AddrPool;
+typedef DenseMap<const MCExpr *, unsigned> AddrPool;
/// \brief Collects and handles information specific to a particular
/// collection of units.
@@ -270,7 +270,7 @@ public:
/// \brief Returns the index into the address pool with the given
/// label/symbol.
- unsigned getAddrPoolIndex(const MCSymbolRefExpr *);
+ unsigned getAddrPoolIndex(const MCExpr *);
unsigned getAddrPoolIndex(const MCSymbol *);
/// \brief Returns the address pool.