OLD | NEW |
1 //===- subzero/src/IceFixups.cpp - Implementation of Assembler Fixups -----===// | 1 //===- subzero/src/IceFixups.cpp - Implementation of Assembler Fixups -----===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file implements the AssemblerFixup class, a very basic | 10 // This file implements the AssemblerFixup class, a very basic |
(...skipping 28 matching lines...) Expand all Loading... |
39 Str << Ctx->mangleName(CR->getName()); | 39 Str << Ctx->mangleName(CR->getName()); |
40 } else { | 40 } else { |
41 // NOTE: currently only float/doubles are put into constant pools. | 41 // NOTE: currently only float/doubles are put into constant pools. |
42 // In the future we may put integers as well. | 42 // In the future we may put integers as well. |
43 assert(llvm::isa<ConstantFloat>(C) || llvm::isa<ConstantDouble>(C)); | 43 assert(llvm::isa<ConstantFloat>(C) || llvm::isa<ConstantDouble>(C)); |
44 C->emitPoolLabel(Str); | 44 C->emitPoolLabel(Str); |
45 } | 45 } |
46 return Str.str(); | 46 return Str.str(); |
47 } | 47 } |
48 | 48 |
49 void AssemblerFixup::emit(GlobalContext *Ctx) const { | 49 void AssemblerFixup::emit(GlobalContext *Ctx, RelocOffsetT BaseOffset) const { |
| 50 if (!ALLOW_DUMP) |
| 51 return; |
50 Ostream &Str = Ctx->getStrEmit(); | 52 Ostream &Str = Ctx->getStrEmit(); |
51 // TODO(jvoung): Not yet clear how to emit a relocation against | 53 if (isNullSymbol()) |
52 // the null symbol. | 54 Str << "__Sz_AbsoluteZero"; |
53 assert(!isNullSymbol()); | 55 else |
54 Str << symbol(Ctx); | 56 Str << symbol(Ctx); |
55 RelocOffsetT Offset = offset(); | 57 RelocOffsetT Offset = offset() + BaseOffset; |
56 if (Offset) | 58 if (Offset) |
57 Str << " + " << Offset; | 59 Str << " + " << Offset; |
58 } | 60 } |
59 | 61 |
60 } // end of namespace Ice | 62 } // end of namespace Ice |
OLD | NEW |