llvm.org GIT mirror llvm / 042aadd
MCAtom extending methods need to extend the range of the atom as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141557 91177308-0d34-0410-b5e6-96231b3b80d8 Owen Anderson 8 years ago
2 changed file(s) with 20 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
4848 bool isTextAtom() { return Type == TextAtom; }
4949 bool isDataAtom() { return Type == DataAtom; }
5050
51 void addInst(const MCInst &I, uint64_t Address) {
52 assert(Type == TextAtom && "Trying to add MCInst to a non-text atom!");
53 Text.push_back(std::make_pair(Address, I));
54 }
55
56 void addData(const MCData &D) {
57 assert(Type == DataAtom && "Trying to add MCData to a non-data atom!");
58 Data.push_back(D);
59 }
51 void addInst(const MCInst &I, uint64_t Address, unsigned Size);
52 void addData(const MCData &D);
6053
6154 /// split - Splits the atom in two at a given address, which must align with
6255 /// and instruction boundary if this is a TextAtom. Returns the newly created
1111 #include "llvm/Support/ErrorHandling.h"
1212
1313 using namespace llvm;
14
15 void MCAtom::addInst(const MCInst &I, uint64_t Address, unsigned Size) {
16 assert(Type == TextAtom && "Trying to add MCInst to a non-text atom!");
17
18 assert(Address < End+Size &&
19 "Instruction not contiguous with end of atom!");
20 if (Address > End)
21 Parent->remap(this, Begin, End+Size);
22
23 Text.push_back(std::make_pair(Address, I));
24 }
25
26 void MCAtom::addData(const MCData &D) {
27 assert(Type == DataAtom && "Trying to add MCData to a non-data atom!");
28 Parent->remap(this, Begin, End+1);
29
30 Data.push_back(D);
31 }
1432
1533 MCAtom *MCAtom::split(uint64_t SplitPt) {
1634 assert((SplitPt > Begin && SplitPt <= End) &&