mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
If bundle alignment is enabled, do not add data to a fragment with instructions
With bundle alignment, instructions all get their own MCFragments (unless they are in a bundle-locked group). For instructions with fixups, this is an MCDataFragment. Emitting actual data (e.g. for .long) attempts to re-use MCDataFragments, which we don't want int this case since it leads to fragments which exceed the bundle size. So, don't reuse them in this case. Also adds a test and fixes some formatting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175316 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -59,7 +59,9 @@ MCFragment *MCObjectStreamer::getCurrentFragment() const {
|
||||
|
||||
MCDataFragment *MCObjectStreamer::getOrCreateDataFragment() const {
|
||||
MCDataFragment *F = dyn_cast_or_null<MCDataFragment>(getCurrentFragment());
|
||||
if (!F)
|
||||
// When bundling is enabled, we don't want to add data to a fragment that
|
||||
// already has instructions (see MCELFStreamer::EmitInstToData for details)
|
||||
if (!F || (Assembler->isBundlingEnabled() && F->hasInstructions()))
|
||||
F = new MCDataFragment(getCurrentSectionData());
|
||||
return F;
|
||||
}
|
||||
|
Reference in New Issue
Block a user