diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-06 19:08:48 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-06 19:08:48 +0000 |
| commit | 0f30fec0bdcd45e4f8251c2c745332c1971bb874 (patch) | |
| tree | ede73f241f9f5490fcf326114d77e1da3a9de7e9 /llvm/lib/Target | |
| parent | 6125206e80ac20c9a1071d996db247c60b638e15 (diff) | |
| download | bcm5719-llvm-0f30fec0bdcd45e4f8251c2c745332c1971bb874.tar.gz bcm5719-llvm-0f30fec0bdcd45e4f8251c2c745332c1971bb874.zip | |
Remove the instruction fragment to data fragment lowering since it was causing
freed data to be read. I will open a bug to track it being reenabled.
llvm-svn: 121028
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMAsmBackend.cpp | 18 | ||||
| -rw-r--r-- | llvm/lib/Target/MBlaze/MBlazeAsmBackend.cpp | 10 | ||||
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCAsmBackend.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86AsmBackend.cpp | 6 |
4 files changed, 18 insertions, 18 deletions
diff --git a/llvm/lib/Target/ARM/ARMAsmBackend.cpp b/llvm/lib/Target/ARM/ARMAsmBackend.cpp index 392a6e6c033..536923e47bf 100644 --- a/llvm/lib/Target/ARM/ARMAsmBackend.cpp +++ b/llvm/lib/Target/ARM/ARMAsmBackend.cpp @@ -138,7 +138,7 @@ public: return Format; } - void ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, + void ApplyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize, uint64_t Value) const; MCObjectWriter *createObjectWriter(raw_ostream &OS) const { @@ -150,8 +150,8 @@ public: }; // Fixme: Raise this to share code between Darwin and ELF. -void ELFARMAsmBackend::ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, - uint64_t Value) const { +void ELFARMAsmBackend::ApplyFixup(const MCFixup &Fixup, char *Data, + unsigned DataSize, uint64_t Value) const { // Fixme: 2 for Thumb unsigned NumBytes = 4; Value = adjustFixupValue(Fixup.getKind(), Value); @@ -162,7 +162,7 @@ void ELFARMAsmBackend::ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, // bits from the fixup value. // The Value has been "split up" into the appropriate bitfields above. for (unsigned i = 0; i != NumBytes; ++i) { - DF.getContents()[Fixup.getOffset() + i] |= uint8_t(Value >> (i * 8)); + Data[Fixup.getOffset() + i] |= uint8_t(Value >> (i * 8)); } } @@ -179,7 +179,7 @@ public: return Format; } - void ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, + void ApplyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize, uint64_t Value) const; MCObjectWriter *createObjectWriter(raw_ostream &OS) const { @@ -207,17 +207,17 @@ static unsigned getFixupKindNumBytes(unsigned Kind) { } } -void DarwinARMAsmBackend::ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, - uint64_t Value) const { +void DarwinARMAsmBackend::ApplyFixup(const MCFixup &Fixup, char *Data, + unsigned DataSize, uint64_t Value) const { unsigned NumBytes = getFixupKindNumBytes(Fixup.getKind()); Value = adjustFixupValue(Fixup.getKind(), Value); - assert(Fixup.getOffset() + NumBytes <= DF.getContents().size() && + assert(Fixup.getOffset() + NumBytes <= DataSize && "Invalid fixup offset!"); // For each byte of the fragment that the fixup touches, mask in the // bits from the fixup value. for (unsigned i = 0; i != NumBytes; ++i) - DF.getContents()[Fixup.getOffset() + i] |= uint8_t(Value >> (i * 8)); + Data[Fixup.getOffset() + i] |= uint8_t(Value >> (i * 8)); } } // end anonymous namespace diff --git a/llvm/lib/Target/MBlaze/MBlazeAsmBackend.cpp b/llvm/lib/Target/MBlaze/MBlazeAsmBackend.cpp index 56c04199cff..0d39d60a89c 100644 --- a/llvm/lib/Target/MBlaze/MBlazeAsmBackend.cpp +++ b/llvm/lib/Target/MBlaze/MBlazeAsmBackend.cpp @@ -110,7 +110,7 @@ public: } - void ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, + void ApplyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize, uint64_t Value) const; MCObjectWriter *createObjectWriter(raw_ostream &OS) const { @@ -121,14 +121,14 @@ public: } }; -void ELFMBlazeAsmBackend::ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, - uint64_t Value) const { +void ELFMBlazeAsmBackend::ApplyFixup(const MCFixup &Fixup, char *Data, + unsigned DataSize, uint64_t Value) const { unsigned Size = getFixupKindSize(Fixup.getKind()); - assert(Fixup.getOffset() + Size <= DF.getContents().size() && + assert(Fixup.getOffset() + Size <= DataSize && "Invalid fixup offset!"); - char *data = DF.getContents().data() + Fixup.getOffset(); + char *data = Data + Fixup.getOffset(); switch (Size) { default: llvm_unreachable("Cannot fixup unknown value."); case 1: llvm_unreachable("Cannot fixup 1 byte value."); diff --git a/llvm/lib/Target/PowerPC/PPCAsmBackend.cpp b/llvm/lib/Target/PowerPC/PPCAsmBackend.cpp index de0ee4ebe9c..29598adfd43 100644 --- a/llvm/lib/Target/PowerPC/PPCAsmBackend.cpp +++ b/llvm/lib/Target/PowerPC/PPCAsmBackend.cpp @@ -64,7 +64,7 @@ namespace { return Format; } - void ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, + void ApplyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize, uint64_t Value) const { assert(0 && "UNIMP"); } diff --git a/llvm/lib/Target/X86/X86AsmBackend.cpp b/llvm/lib/Target/X86/X86AsmBackend.cpp index 48467c89e5b..5626fd7afd3 100644 --- a/llvm/lib/Target/X86/X86AsmBackend.cpp +++ b/llvm/lib/Target/X86/X86AsmBackend.cpp @@ -49,14 +49,14 @@ public: X86AsmBackend(const Target &T) : TargetAsmBackend() {} - void ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, + void ApplyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize, uint64_t Value) const { unsigned Size = 1 << getFixupKindLog2Size(Fixup.getKind()); - assert(Fixup.getOffset() + Size <= DF.getContents().size() && + assert(Fixup.getOffset() + Size <= DataSize && "Invalid fixup offset!"); for (unsigned i = 0; i != Size; ++i) - DF.getContents()[Fixup.getOffset() + i] = uint8_t(Value >> (i * 8)); + Data[Fixup.getOffset() + i] = uint8_t(Value >> (i * 8)); } bool MayNeedRelaxation(const MCInst &Inst) const; |

