diff options
| author | Oliver Stannard <oliver.stannard@arm.com> | 2015-11-16 16:25:47 +0000 |
|---|---|---|
| committer | Oliver Stannard <oliver.stannard@arm.com> | 2015-11-16 16:25:47 +0000 |
| commit | 9327a7575b1d5ed96d1f551f520d84f894156c07 (patch) | |
| tree | 1b508742ed633de32324b1a39a4438b1fb0801de /llvm/include | |
| parent | 09be0606066d411619396ad80c7f3a7c451aef39 (diff) | |
| download | bcm5719-llvm-9327a7575b1d5ed96d1f551f520d84f894156c07.tar.gz bcm5719-llvm-9327a7575b1d5ed96d1f551f520d84f894156c07.zip | |
[ARM,AArch64] Store source location of asm constant pool entries
Storing the source location of the expression that created a constant pool
entry allows us to emit better error messages if we later discover that the
expression cannot be represented by a relocation.
Differential Revision: http://reviews.llvm.org/D14646
llvm-svn: 253220
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/MC/ConstantPools.h | 10 | ||||
| -rw-r--r-- | llvm/include/llvm/MC/MCStreamer.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/llvm/include/llvm/MC/ConstantPools.h b/llvm/include/llvm/MC/ConstantPools.h index 9aa4663ba0f..552e1443e7d 100644 --- a/llvm/include/llvm/MC/ConstantPools.h +++ b/llvm/include/llvm/MC/ConstantPools.h @@ -17,6 +17,7 @@ #include "llvm/ADT/MapVector.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Support/SMLoc.h" namespace llvm { class MCContext; @@ -26,11 +27,12 @@ class MCStreamer; class MCSymbol; struct ConstantPoolEntry { - ConstantPoolEntry(MCSymbol *L, const MCExpr *Val, unsigned Sz) - : Label(L), Value(Val), Size(Sz) {} + ConstantPoolEntry(MCSymbol *L, const MCExpr *Val, unsigned Sz, SMLoc Loc_) + : Label(L), Value(Val), Size(Sz), Loc(Loc_) {} MCSymbol *Label; const MCExpr *Value; unsigned Size; + SMLoc Loc; }; // A class to keep track of assembler-generated constant pools that are use to @@ -49,7 +51,7 @@ public: // // \returns a MCExpr that references the newly inserted value const MCExpr *addEntry(const MCExpr *Value, MCContext &Context, - unsigned Size); + unsigned Size, SMLoc Loc); // Emit the contents of the constant pool using the provided streamer. void emitEntries(MCStreamer &Streamer); @@ -80,7 +82,7 @@ public: void emitAll(MCStreamer &Streamer); void emitForCurrentSection(MCStreamer &Streamer); const MCExpr *addEntry(MCStreamer &Streamer, const MCExpr *Expr, - unsigned Size); + unsigned Size, SMLoc Loc); private: ConstantPool *getConstantPool(MCSection *Section); diff --git a/llvm/include/llvm/MC/MCStreamer.h b/llvm/include/llvm/MC/MCStreamer.h index 02b9d18af5f..46afebebc0d 100644 --- a/llvm/include/llvm/MC/MCStreamer.h +++ b/llvm/include/llvm/MC/MCStreamer.h @@ -134,7 +134,7 @@ public: /// Callback used to implement the ldr= pseudo. /// Add a new entry to the constant pool for the current section and return an /// MCExpr that can be used to refer to the constant pool location. - const MCExpr *addConstantPoolEntry(const MCExpr *); + const MCExpr *addConstantPoolEntry(const MCExpr *, SMLoc Loc); /// Callback used to implemnt the .ltorg directive. /// Emit contents of constant pool for the current section. |

