Allow creation of single-byte MCAtoms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184344 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ahmed Bougacha 2013-06-19 20:18:59 +00:00
parent ad966ea7a8
commit 7ab184a2a1
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ static bool AtomComp(const MCAtom *L, uint64_t Addr) {
void MCModule::map(MCAtom *NewAtom) { void MCModule::map(MCAtom *NewAtom) {
uint64_t Begin = NewAtom->Begin; uint64_t Begin = NewAtom->Begin;
assert(Begin < NewAtom->End && "Creating MCAtom with endpoints reversed?"); assert(Begin <= NewAtom->End && "Creating MCAtom with endpoints reversed?");
// Check for atoms already covering this range. // Check for atoms already covering this range.
AtomListTy::iterator I = std::lower_bound(atom_begin(), atom_end(), AtomListTy::iterator I = std::lower_bound(atom_begin(), atom_end(),

View File

@ -126,6 +126,7 @@ void MCObjectDisassembler::buildCFG(MCModule *Module) {
MCTextAtom *TA = dyn_cast<MCTextAtom>(*AI); MCTextAtom *TA = dyn_cast<MCTextAtom>(*AI);
if (!TA) continue; if (!TA) continue;
Calls.insert(TA->getBeginAddr()); Calls.insert(TA->getBeginAddr());
BBInfos[TA->getBeginAddr()].Atom = TA;
for (MCTextAtom::const_iterator II = TA->begin(), IE = TA->end(); for (MCTextAtom::const_iterator II = TA->begin(), IE = TA->end();
II != IE; ++II) { II != IE; ++II) {
if (MIA.isTerminator(II->Inst)) if (MIA.isTerminator(II->Inst))
@ -145,7 +146,6 @@ void MCObjectDisassembler::buildCFG(MCModule *Module) {
MCAtom *A = Module->findAtomContaining(*SI); MCAtom *A = Module->findAtomContaining(*SI);
if (!A) continue; if (!A) continue;
MCTextAtom *TA = cast<MCTextAtom>(A); MCTextAtom *TA = cast<MCTextAtom>(A);
BBInfos[TA->getBeginAddr()].Atom = TA;
if (TA->getBeginAddr() == *SI) if (TA->getBeginAddr() == *SI)
continue; continue;
MCTextAtom *NewAtom = TA->split(*SI); MCTextAtom *NewAtom = TA->split(*SI);