S.getName() + "'");
return false;
}
- Val = Layout.getFragmentOffset(SD.getFragment()) + SD.getOffset();
+ Val = Layout.getFragmentOffset(SD.getFragment()) + S.getOffset();
return true;
}
const MCSymbol &ASym = A->getSymbol();
const MCAssembler &Asm = getAssembler();
- const MCSymbolData &ASD = Asm.getSymbolData(ASym);
- if (ASD.isCommon()) {
+ if (ASym.isCommon()) {
// FIXME: we should probably add a SMLoc to MCExpr.
Asm.getContext().reportFatalError(SMLoc(),
"Common symbol " + ASym.getName() +
/* *** */
-MCSectionData::MCSectionData(MCSection &Section) : Section(&Section) {}
-
-/* *** */
-
MCAssembler::MCAssembler(MCContext &Context_, MCAsmBackend &Backend_,
MCCodeEmitter &Emitter_, MCObjectWriter &Writer_,
raw_ostream &OS_)
assert(Layout.getSectionFileSize(Sec) == 0 && "Invalid size for section!");
// Check that contents are only things legal inside a virtual section.
- for (MCSectionData::const_iterator it = Sec->begin(), ie = Sec->end();
- it != ie; ++it) {
+ for (MCSection::const_iterator it = Sec->begin(), ie = Sec->end(); it != ie;
+ ++it) {
switch (it->getKind()) {
default: llvm_unreachable("Invalid fragment in virtual section!");
case MCFragment::FT_Data: {
uint64_t Start = getWriter().getStream().tell();
(void)Start;
- for (MCSectionData::const_iterator it = Sec->begin(), ie = Sec->end();
- it != ie; ++it)
+ for (MCSection::const_iterator it = Sec->begin(), ie = Sec->end(); it != ie;
+ ++it)
writeFragment(*this, Layout, *it);
assert(getWriter().getStream().tell() - Start ==
Sec->setLayoutOrder(i);
unsigned FragmentIndex = 0;
- for (MCSectionData::iterator iFrag = Sec->begin(), iFragEnd = Sec->end();
+ for (MCSection::iterator iFrag = Sec->begin(), iFragEnd = Sec->end();
iFrag != iFragEnd; ++iFrag)
iFrag->setLayoutOrder(FragmentIndex++);
}
// Evaluate and apply the fixups, generating relocation entries as necessary.
for (MCAssembler::iterator it = begin(), ie = end(); it != ie; ++it) {
- for (MCSectionData::iterator it2 = it->begin(),
- ie2 = it->end(); it2 != ie2; ++it2) {
+ for (MCSection::iterator it2 = it->begin(), ie2 = it->end(); it2 != ie2;
+ ++it2) {
MCEncodedFragmentWithFixups *F =
dyn_cast<MCEncodedFragmentWithFixups>(it2);
if (F) {
MCFragment *FirstRelaxedFragment = nullptr;
// Attempt to relax all the fragments in the section.
- for (MCSectionData::iterator I = Sec.begin(), IE = Sec.end(); I != IE; ++I) {
+ for (MCSection::iterator I = Sec.begin(), IE = Sec.end(); I != IE; ++I) {
// Check if this is a fragment that needs relaxation.
bool RelaxedFrag = false;
switch(I->getKind()) {
OS << ">";
}
-void MCSectionData::dump() {
- raw_ostream &OS = llvm::errs();
-
- OS << "<MCSectionData";
- OS << " Fragments:[\n ";
- for (iterator it = begin(), ie = end(); it != ie; ++it) {
- if (it != begin()) OS << ",\n ";
- it->dump();
- }
- OS << "]>";
-}
-
void MCSymbolData::dump() const {
raw_ostream &OS = llvm::errs();
OS << "<MCSymbolData"
<< " Fragment:" << getFragment();
- if (!isCommon())
- OS << " Offset:" << getOffset();
OS << " Flags:" << getFlags();
- if (isCommon())
- OS << " (common, size:" << getCommonSize()
- << " align: " << getCommonAlignment() << ")";
if (isExternal())
OS << " (external)";
if (isPrivateExtern())
OS << " Sections:[\n ";
for (iterator it = begin(), ie = end(); it != ie; ++it) {
if (it != begin()) OS << ",\n ";
- it->getSectionData().dump();
+ it->dump();
}
OS << "],\n";
OS << " Symbols:[";