[llvm] r184344 - Allow creation of single-byte MCAtoms.
Ahmed Bougacha
ahmed.bougacha at gmail.com
Wed Jun 19 13:18:59 PDT 2013
Author: ab
Date: Wed Jun 19 15:18:59 2013
New Revision: 184344
URL: http://llvm.org/viewvc/llvm-project?rev=184344&view=rev
Log:
Allow creation of single-byte MCAtoms.
Modified:
llvm/trunk/lib/MC/MCModule.cpp
llvm/trunk/lib/MC/MCObjectDisassembler.cpp
Modified: llvm/trunk/lib/MC/MCModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCModule.cpp?rev=184344&r1=184343&r2=184344&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCModule.cpp (original)
+++ llvm/trunk/lib/MC/MCModule.cpp Wed Jun 19 15:18:59 2013
@@ -21,7 +21,7 @@ static bool AtomComp(const MCAtom *L, ui
void MCModule::map(MCAtom *NewAtom) {
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.
AtomListTy::iterator I = std::lower_bound(atom_begin(), atom_end(),
Modified: llvm/trunk/lib/MC/MCObjectDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectDisassembler.cpp?rev=184344&r1=184343&r2=184344&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCObjectDisassembler.cpp (original)
+++ llvm/trunk/lib/MC/MCObjectDisassembler.cpp Wed Jun 19 15:18:59 2013
@@ -126,6 +126,7 @@ void MCObjectDisassembler::buildCFG(MCMo
MCTextAtom *TA = dyn_cast<MCTextAtom>(*AI);
if (!TA) continue;
Calls.insert(TA->getBeginAddr());
+ BBInfos[TA->getBeginAddr()].Atom = TA;
for (MCTextAtom::const_iterator II = TA->begin(), IE = TA->end();
II != IE; ++II) {
if (MIA.isTerminator(II->Inst))
@@ -145,7 +146,6 @@ void MCObjectDisassembler::buildCFG(MCMo
MCAtom *A = Module->findAtomContaining(*SI);
if (!A) continue;
MCTextAtom *TA = cast<MCTextAtom>(A);
- BBInfos[TA->getBeginAddr()].Atom = TA;
if (TA->getBeginAddr() == *SI)
continue;
MCTextAtom *NewAtom = TA->split(*SI);
More information about the llvm-commits
mailing list