summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-10-10 18:09:38 +0000
committerOwen Anderson <resistor@mac.com>2011-10-10 18:09:38 +0000
commitbed5504f5ff6282f093b9198a618f3bbda0d3313 (patch)
tree984d8103acf9a78dc7a70f31aecfa2701a8440c1 /llvm/lib
parenta319b84f6ab4d128db096a8b9a7a0ac935f12f6c (diff)
downloadbcm5719-llvm-bed5504f5ff6282f093b9198a618f3bbda0d3313.tar.gz
bcm5719-llvm-bed5504f5ff6282f093b9198a618f3bbda0d3313.zip
MCAtom extending methods need to extend the range of the atom as well.
llvm-svn: 141557
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCAtom.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCAtom.cpp b/llvm/lib/MC/MCAtom.cpp
index cd7dbf334b0..d71444324f3 100644
--- a/llvm/lib/MC/MCAtom.cpp
+++ b/llvm/lib/MC/MCAtom.cpp
@@ -13,6 +13,24 @@
using namespace llvm;
+void MCAtom::addInst(const MCInst &I, uint64_t Address, unsigned Size) {
+ assert(Type == TextAtom && "Trying to add MCInst to a non-text atom!");
+
+ assert(Address < End+Size &&
+ "Instruction not contiguous with end of atom!");
+ if (Address > End)
+ Parent->remap(this, Begin, End+Size);
+
+ Text.push_back(std::make_pair(Address, I));
+}
+
+void MCAtom::addData(const MCData &D) {
+ assert(Type == DataAtom && "Trying to add MCData to a non-data atom!");
+ Parent->remap(this, Begin, End+1);
+
+ Data.push_back(D);
+}
+
MCAtom *MCAtom::split(uint64_t SplitPt) {
assert((SplitPt > Begin && SplitPt <= End) &&
"Splitting at point not contained in atom!");
OpenPOWER on IntegriCloud