LLVM  13.0.0git
MCFragment.cpp
Go to the documentation of this file.
1 //===- lib/MC/MCFragment.cpp - Assembler Fragment Implementation ----------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "llvm/MC/MCFragment.h"
10 #include "llvm/ADT/SmallVector.h"
11 #include "llvm/ADT/StringExtras.h"
12 #include "llvm/ADT/Twine.h"
13 #include "llvm/Config/llvm-config.h"
14 #include "llvm/MC/MCAsmLayout.h"
15 #include "llvm/MC/MCAssembler.h"
16 #include "llvm/MC/MCContext.h"
17 #include "llvm/MC/MCExpr.h"
18 #include "llvm/MC/MCFixup.h"
19 #include "llvm/MC/MCSection.h"
20 #include "llvm/MC/MCSymbol.h"
21 #include "llvm/MC/MCValue.h"
22 #include "llvm/Support/Casting.h"
23 #include "llvm/Support/Compiler.h"
26 #include <cassert>
27 #include <cstdint>
28 #include <utility>
29 
30 using namespace llvm;
31 
33  // Compute the section layout order. Virtual sections must go last.
34  for (MCSection &Sec : Asm)
35  if (!Sec.isVirtualSection())
36  SectionOrder.push_back(&Sec);
37  for (MCSection &Sec : Asm)
38  if (Sec.isVirtualSection())
39  SectionOrder.push_back(&Sec);
40 }
41 
42 bool MCAsmLayout::isFragmentValid(const MCFragment *F) const {
43  const MCSection *Sec = F->getParent();
44  const MCFragment *LastValid = LastValidFragment.lookup(Sec);
45  if (!LastValid)
46  return false;
47  assert(LastValid->getParent() == Sec);
48  return F->getLayoutOrder() <= LastValid->getLayoutOrder();
49 }
50 
52  MCSection *Sec = F->getParent();
54  if (MCFragment *LastValid = LastValidFragment[Sec]) {
55  // Fragment already valid, offset is available.
56  if (F->getLayoutOrder() <= LastValid->getLayoutOrder())
57  return true;
58  I = ++MCSection::iterator(LastValid);
59  } else
60  I = Sec->begin();
61 
62  // A fragment ordered before F is currently being laid out.
63  const MCFragment *FirstInvalidFragment = &*I;
64  if (FirstInvalidFragment->IsBeingLaidOut)
65  return false;
66 
67  return true;
68 }
69 
71  // If this fragment wasn't already valid, we don't need to do anything.
72  if (!isFragmentValid(F))
73  return;
74 
75  // Otherwise, reset the last valid fragment to the previous fragment
76  // (if this is the first fragment, it will be NULL).
77  LastValidFragment[F->getParent()] = F->getPrevNode();
78 }
79 
80 void MCAsmLayout::ensureValid(const MCFragment *F) const {
81  MCSection *Sec = F->getParent();
83  if (MCFragment *Cur = LastValidFragment[Sec])
84  I = ++MCSection::iterator(Cur);
85  else
86  I = Sec->begin();
87 
88  // Advance the layout position until the fragment is valid.
89  while (!isFragmentValid(F)) {
90  assert(I != Sec->end() && "Layout bookkeeping error");
91  const_cast<MCAsmLayout *>(this)->layoutFragment(&*I);
92  ++I;
93  }
94 }
95 
97  ensureValid(F);
98  assert(F->Offset != ~UINT64_C(0) && "Address not set!");
99  return F->Offset;
100 }
101 
102 // Simple getSymbolOffset helper for the non-variable case.
103 static bool getLabelOffset(const MCAsmLayout &Layout, const MCSymbol &S,
104  bool ReportError, uint64_t &Val) {
105  if (!S.getFragment()) {
106  if (ReportError)
107  report_fatal_error("unable to evaluate offset to undefined symbol '" +
108  S.getName() + "'");
109  return false;
110  }
111  Val = Layout.getFragmentOffset(S.getFragment()) + S.getOffset();
112  return true;
113 }
114 
115 static bool getSymbolOffsetImpl(const MCAsmLayout &Layout, const MCSymbol &S,
116  bool ReportError, uint64_t &Val) {
117  if (!S.isVariable())
118  return getLabelOffset(Layout, S, ReportError, Val);
119 
120  // If SD is a variable, evaluate it.
121  MCValue Target;
122  if (!S.getVariableValue()->evaluateAsValue(Target, Layout))
123  report_fatal_error("unable to evaluate offset for variable '" +
124  S.getName() + "'");
125 
126  uint64_t Offset = Target.getConstant();
127 
128  const MCSymbolRefExpr *A = Target.getSymA();
129  if (A) {
130  uint64_t ValA;
131  if (!getLabelOffset(Layout, A->getSymbol(), ReportError, ValA))
132  return false;
133  Offset += ValA;
134  }
135 
136  const MCSymbolRefExpr *B = Target.getSymB();
137  if (B) {
138  uint64_t ValB;
139  if (!getLabelOffset(Layout, B->getSymbol(), ReportError, ValB))
140  return false;
141  Offset -= ValB;
142  }
143 
144  Val = Offset;
145  return true;
146 }
147 
148 bool MCAsmLayout::getSymbolOffset(const MCSymbol &S, uint64_t &Val) const {
149  return getSymbolOffsetImpl(*this, S, false, Val);
150 }
151 
152 uint64_t MCAsmLayout::getSymbolOffset(const MCSymbol &S) const {
153  uint64_t Val;
154  getSymbolOffsetImpl(*this, S, true, Val);
155  return Val;
156 }
157 
159  if (!Symbol.isVariable())
160  return &Symbol;
161 
162  const MCExpr *Expr = Symbol.getVariableValue();
163  MCValue Value;
164  if (!Expr->evaluateAsValue(Value, *this)) {
165  Assembler.getContext().reportError(
166  Expr->getLoc(), "expression could not be evaluated");
167  return nullptr;
168  }
169 
170  const MCSymbolRefExpr *RefB = Value.getSymB();
171  if (RefB) {
172  Assembler.getContext().reportError(
173  Expr->getLoc(), Twine("symbol '") + RefB->getSymbol().getName() +
174  "' could not be evaluated in a subtraction expression");
175  return nullptr;
176  }
177 
178  const MCSymbolRefExpr *A = Value.getSymA();
179  if (!A)
180  return nullptr;
181 
182  const MCSymbol &ASym = A->getSymbol();
183  const MCAssembler &Asm = getAssembler();
184  if (ASym.isCommon()) {
185  Asm.getContext().reportError(Expr->getLoc(),
186  "Common symbol '" + ASym.getName() +
187  "' cannot be used in assignment expr");
188  return nullptr;
189  }
190 
191  return &ASym;
192 }
193 
194 uint64_t MCAsmLayout::getSectionAddressSize(const MCSection *Sec) const {
195  // The size is the last fragment's end offset.
196  const MCFragment &F = Sec->getFragmentList().back();
198 }
199 
200 uint64_t MCAsmLayout::getSectionFileSize(const MCSection *Sec) const {
201  // Virtual sections have no file size.
202  if (Sec->isVirtualSection())
203  return 0;
204 
205  // Otherwise, the file size is the same as the address space size.
206  return getSectionAddressSize(Sec);
207 }
208 
209 uint64_t llvm::computeBundlePadding(const MCAssembler &Assembler,
210  const MCEncodedFragment *F,
211  uint64_t FOffset, uint64_t FSize) {
212  uint64_t BundleSize = Assembler.getBundleAlignSize();
213  assert(BundleSize > 0 &&
214  "computeBundlePadding should only be called if bundling is enabled");
215  uint64_t BundleMask = BundleSize - 1;
216  uint64_t OffsetInBundle = FOffset & BundleMask;
217  uint64_t EndOfFragment = OffsetInBundle + FSize;
218 
219  // There are two kinds of bundling restrictions:
220  //
221  // 1) For alignToBundleEnd(), add padding to ensure that the fragment will
222  // *end* on a bundle boundary.
223  // 2) Otherwise, check if the fragment would cross a bundle boundary. If it
224  // would, add padding until the end of the bundle so that the fragment
225  // will start in a new one.
226  if (F->alignToBundleEnd()) {
227  // Three possibilities here:
228  //
229  // A) The fragment just happens to end at a bundle boundary, so we're good.
230  // B) The fragment ends before the current bundle boundary: pad it just
231  // enough to reach the boundary.
232  // C) The fragment ends after the current bundle boundary: pad it until it
233  // reaches the end of the next bundle boundary.
234  //
235  // Note: this code could be made shorter with some modulo trickery, but it's
236  // intentionally kept in its more explicit form for simplicity.
237  if (EndOfFragment == BundleSize)
238  return 0;
239  else if (EndOfFragment < BundleSize)
240  return BundleSize - EndOfFragment;
241  else { // EndOfFragment > BundleSize
242  return 2 * BundleSize - EndOfFragment;
243  }
244  } else if (OffsetInBundle > 0 && EndOfFragment > BundleSize)
245  return BundleSize - OffsetInBundle;
246  else
247  return 0;
248 }
249 
250 /* *** */
251 
253 
255  MCSection *Parent)
256  : Parent(Parent), Atom(nullptr), Offset(~UINT64_C(0)), LayoutOrder(0),
257  Kind(Kind), IsBeingLaidOut(false), HasInstructions(HasInstructions) {
258  if (Parent && !isa<MCDummyFragment>(*this))
259  Parent->getFragmentList().push_back(this);
260 }
261 
263  // First check if we are the sentinal.
264  if (Kind == FragmentType(~0)) {
265  delete this;
266  return;
267  }
268 
269  switch (Kind) {
270  case FT_Align:
271  delete cast<MCAlignFragment>(this);
272  return;
273  case FT_Data:
274  delete cast<MCDataFragment>(this);
275  return;
277  delete cast<MCCompactEncodedInstFragment>(this);
278  return;
279  case FT_Fill:
280  delete cast<MCFillFragment>(this);
281  return;
282  case FT_Nops:
283  delete cast<MCNopsFragment>(this);
284  return;
285  case FT_Relaxable:
286  delete cast<MCRelaxableFragment>(this);
287  return;
288  case FT_Org:
289  delete cast<MCOrgFragment>(this);
290  return;
291  case FT_Dwarf:
292  delete cast<MCDwarfLineAddrFragment>(this);
293  return;
294  case FT_DwarfFrame:
295  delete cast<MCDwarfCallFrameFragment>(this);
296  return;
297  case FT_LEB:
298  delete cast<MCLEBFragment>(this);
299  return;
300  case FT_BoundaryAlign:
301  delete cast<MCBoundaryAlignFragment>(this);
302  return;
303  case FT_SymbolId:
304  delete cast<MCSymbolIdFragment>(this);
305  return;
306  case FT_CVInlineLines:
307  delete cast<MCCVInlineLineTableFragment>(this);
308  return;
309  case FT_CVDefRange:
310  delete cast<MCCVDefRangeFragment>(this);
311  return;
312  case FT_PseudoProbe:
313  delete cast<MCPseudoProbeAddrFragment>(this);
314  return;
315  case FT_Dummy:
316  delete cast<MCDummyFragment>(this);
317  return;
318  }
319 }
320 
321 // Debugging methods
322 
323 namespace llvm {
324 
326  OS << "<MCFixup" << " Offset:" << AF.getOffset()
327  << " Value:" << *AF.getValue()
328  << " Kind:" << AF.getKind() << ">";
329  return OS;
330 }
331 
332 } // end namespace llvm
333 
334 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
336  raw_ostream &OS = errs();
337 
338  OS << "<";
339  switch (getKind()) {
340  case MCFragment::FT_Align: OS << "MCAlignFragment"; break;
341  case MCFragment::FT_Data: OS << "MCDataFragment"; break;
343  OS << "MCCompactEncodedInstFragment"; break;
344  case MCFragment::FT_Fill: OS << "MCFillFragment"; break;
345  case MCFragment::FT_Nops:
346  OS << "MCFNopsFragment";
347  break;
348  case MCFragment::FT_Relaxable: OS << "MCRelaxableFragment"; break;
349  case MCFragment::FT_Org: OS << "MCOrgFragment"; break;
350  case MCFragment::FT_Dwarf: OS << "MCDwarfFragment"; break;
351  case MCFragment::FT_DwarfFrame: OS << "MCDwarfCallFrameFragment"; break;
352  case MCFragment::FT_LEB: OS << "MCLEBFragment"; break;
353  case MCFragment::FT_BoundaryAlign: OS<<"MCBoundaryAlignFragment"; break;
354  case MCFragment::FT_SymbolId: OS << "MCSymbolIdFragment"; break;
355  case MCFragment::FT_CVInlineLines: OS << "MCCVInlineLineTableFragment"; break;
356  case MCFragment::FT_CVDefRange: OS << "MCCVDefRangeTableFragment"; break;
358  OS << "MCPseudoProbe";
359  break;
360  case MCFragment::FT_Dummy: OS << "MCDummyFragment"; break;
361  }
362 
363  OS << "<MCFragment " << (const void *)this << " LayoutOrder:" << LayoutOrder
364  << " Offset:" << Offset << " HasInstructions:" << hasInstructions();
365  if (const auto *EF = dyn_cast<MCEncodedFragment>(this))
366  OS << " BundlePadding:" << static_cast<unsigned>(EF->getBundlePadding());
367  OS << ">";
368 
369  switch (getKind()) {
370  case MCFragment::FT_Align: {
371  const auto *AF = cast<MCAlignFragment>(this);
372  if (AF->hasEmitNops())
373  OS << " (emit nops)";
374  OS << "\n ";
375  OS << " Alignment:" << AF->getAlignment()
376  << " Value:" << AF->getValue() << " ValueSize:" << AF->getValueSize()
377  << " MaxBytesToEmit:" << AF->getMaxBytesToEmit() << ">";
378  break;
379  }
380  case MCFragment::FT_Data: {
381  const auto *DF = cast<MCDataFragment>(this);
382  OS << "\n ";
383  OS << " Contents:[";
384  const SmallVectorImpl<char> &Contents = DF->getContents();
385  for (unsigned i = 0, e = Contents.size(); i != e; ++i) {
386  if (i) OS << ",";
387  OS << hexdigit((Contents[i] >> 4) & 0xF) << hexdigit(Contents[i] & 0xF);
388  }
389  OS << "] (" << Contents.size() << " bytes)";
390 
391  if (DF->fixup_begin() != DF->fixup_end()) {
392  OS << ",\n ";
393  OS << " Fixups:[";
394  for (MCDataFragment::const_fixup_iterator it = DF->fixup_begin(),
395  ie = DF->fixup_end(); it != ie; ++it) {
396  if (it != DF->fixup_begin()) OS << ",\n ";
397  OS << *it;
398  }
399  OS << "]";
400  }
401  break;
402  }
404  const auto *CEIF =
405  cast<MCCompactEncodedInstFragment>(this);
406  OS << "\n ";
407  OS << " Contents:[";
408  const SmallVectorImpl<char> &Contents = CEIF->getContents();
409  for (unsigned i = 0, e = Contents.size(); i != e; ++i) {
410  if (i) OS << ",";
411  OS << hexdigit((Contents[i] >> 4) & 0xF) << hexdigit(Contents[i] & 0xF);
412  }
413  OS << "] (" << Contents.size() << " bytes)";
414  break;
415  }
416  case MCFragment::FT_Fill: {
417  const auto *FF = cast<MCFillFragment>(this);
418  OS << " Value:" << static_cast<unsigned>(FF->getValue())
419  << " ValueSize:" << static_cast<unsigned>(FF->getValueSize())
420  << " NumValues:" << FF->getNumValues();
421  break;
422  }
423  case MCFragment::FT_Nops: {
424  const auto *NF = cast<MCNopsFragment>(this);
425  OS << " NumBytes:" << NF->getNumBytes()
426  << " ControlledNopLength:" << NF->getControlledNopLength();
427  break;
428  }
430  const auto *F = cast<MCRelaxableFragment>(this);
431  OS << "\n ";
432  OS << " Inst:";
433  F->getInst().dump_pretty(OS);
434  OS << " (" << F->getContents().size() << " bytes)";
435  break;
436  }
437  case MCFragment::FT_Org: {
438  const auto *OF = cast<MCOrgFragment>(this);
439  OS << "\n ";
440  OS << " Offset:" << OF->getOffset()
441  << " Value:" << static_cast<unsigned>(OF->getValue());
442  break;
443  }
444  case MCFragment::FT_Dwarf: {
445  const auto *OF = cast<MCDwarfLineAddrFragment>(this);
446  OS << "\n ";
447  OS << " AddrDelta:" << OF->getAddrDelta()
448  << " LineDelta:" << OF->getLineDelta();
449  break;
450  }
452  const auto *CF = cast<MCDwarfCallFrameFragment>(this);
453  OS << "\n ";
454  OS << " AddrDelta:" << CF->getAddrDelta();
455  break;
456  }
457  case MCFragment::FT_LEB: {
458  const auto *LF = cast<MCLEBFragment>(this);
459  OS << "\n ";
460  OS << " Value:" << LF->getValue() << " Signed:" << LF->isSigned();
461  break;
462  }
464  const auto *BF = cast<MCBoundaryAlignFragment>(this);
465  OS << "\n ";
466  OS << " BoundarySize:" << BF->getAlignment().value()
467  << " LastFragment:" << BF->getLastFragment()
468  << " Size:" << BF->getSize();
469  break;
470  }
472  const auto *F = cast<MCSymbolIdFragment>(this);
473  OS << "\n ";
474  OS << " Sym:" << F->getSymbol();
475  break;
476  }
478  const auto *F = cast<MCCVInlineLineTableFragment>(this);
479  OS << "\n ";
480  OS << " Sym:" << *F->getFnStartSym();
481  break;
482  }
484  const auto *F = cast<MCCVDefRangeFragment>(this);
485  OS << "\n ";
486  for (std::pair<const MCSymbol *, const MCSymbol *> RangeStartEnd :
487  F->getRanges()) {
488  OS << " RangeStart:" << RangeStartEnd.first;
489  OS << " RangeEnd:" << RangeStartEnd.second;
490  }
491  break;
492  }
494  const auto *OF = cast<MCPseudoProbeAddrFragment>(this);
495  OS << "\n ";
496  OS << " AddrDelta:" << OF->getAddrDelta();
497  break;
498  }
500  break;
501  }
502  OS << ">";
503 }
504 #endif
i
i
Definition: README.txt:29
llvm::MCFragment::FT_DwarfFrame
@ FT_DwarfFrame
Definition: MCFragment.h:44
LLVM_DUMP_METHOD
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Definition: Compiler.h:499
llvm
Definition: AllocatorList.h:23
llvm::MCFragment::FT_BoundaryAlign
@ FT_BoundaryAlign
Definition: MCFragment.h:46
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::MCExpr::evaluateAsValue
bool evaluateAsValue(MCValue &Res, const MCAsmLayout &Layout) const
Try to evaluate the expression to the form (a - b + constant) where neither a nor b are variables.
Definition: MCExpr.cpp:774
llvm::iplist_impl::push_back
void push_back(pointer val)
Definition: ilist.h:313
llvm::MCFragment::FT_CVInlineLines
@ FT_CVInlineLines
Definition: MCFragment.h:48
it
Reference model for inliner Oz decision policy Note this model is also referenced by test Transforms Inline ML tests if replacing it
Definition: README.txt:3
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:125
ErrorHandling.h
MCFragment.h
MCAssembler.h
llvm::MCAssembler::computeFragmentSize
uint64_t computeFragmentSize(const MCAsmLayout &Layout, const MCFragment &F) const
Compute the effective fragment size assuming it is laid out at the given SectionAddress and FragmentO...
Definition: MCAssembler.cpp:289
llvm::MCFragment::getParent
MCSection * getParent() const
Definition: MCFragment.h:96
llvm::AMDGPU::Exp::Target
Target
Definition: SIDefines.h:732
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::errs
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Definition: raw_ostream.cpp:892
llvm::MCEncodedFragmentWithFixups< 32, 4 >::const_fixup_iterator
SmallVectorImpl< MCFixup >::const_iterator const_fixup_iterator
Definition: MCFragment.h:220
llvm::MCFragment::FT_CVDefRange
@ FT_CVDefRange
Definition: MCFragment.h:49
llvm::MCSection::getFragmentList
MCSection::FragmentListType & getFragmentList()
Definition: MCSection.h:157
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::MCFragment::dump
void dump() const
Definition: MCFragment.cpp:335
llvm::MCSection::iterator
FragmentListType::iterator iterator
Definition: MCSection.h:55
llvm::MCFragment
Definition: MCFragment.h:31
getSymbolOffsetImpl
static bool getSymbolOffsetImpl(const MCAsmLayout &Layout, const MCSymbol &S, bool ReportError, uint64_t &Val)
Definition: MCFragment.cpp:115
llvm::MCFixup::getValue
const MCExpr * getValue() const
Definition: MCFixup.h:137
llvm::MCFragment::FragmentType
FragmentType
Definition: MCFragment.h:35
llvm::MCFragment::MCFragment
MCFragment()=delete
llvm::MCAsmLayout::invalidateFragmentsFrom
void invalidateFragmentsFrom(MCFragment *F)
Invalidate the fragments starting with F because it has been resized.
Definition: MCFragment.cpp:70
llvm::MCAssembler::getContext
MCContext & getContext() const
Definition: MCAssembler.h:292
Twine.h
MCContext.h
MCSymbol.h
false
Definition: StackSlotColoring.cpp:142
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
llvm::report_fatal_error
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:140
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:50
llvm::MCAsmLayout::layoutFragment
void layoutFragment(MCFragment *Fragment)
Perform layout for a single fragment, assuming that the previous fragment has already been laid out c...
Definition: MCAssembler.cpp:395
llvm::MCSymbolRefExpr::getSymbol
const MCSymbol & getSymbol() const
Definition: MCExpr.h:397
llvm::operator<<
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:230
llvm::MCSymbol::getName
StringRef getName() const
getName - Get the symbol name.
Definition: MCSymbol.h:197
llvm::MCFragment::hasInstructions
bool hasInstructions() const
Does this fragment have instructions emitted into it? By default this is false, but specific fragment...
Definition: MCFragment.h:107
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
DF
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
llvm::MCAsmLayout::getSectionFileSize
uint64_t getSectionFileSize(const MCSection *Sec) const
Get the data size of the given section, as emitted to the object file.
Definition: MCFragment.cpp:200
llvm::MCFragment::FT_LEB
@ FT_LEB
Definition: MCFragment.h:45
llvm::MCEncodedFragment
Interface implemented by fragments that contain encoded instructions and/or data.
Definition: MCFragment.h:125
llvm::MCAssembler
Definition: MCAssembler.h:60
llvm::MCAsmLayout::getBaseSymbol
const MCSymbol * getBaseSymbol(const MCSymbol &Symbol) const
If this symbol is equivalent to A + Constant, return A.
Definition: MCFragment.cpp:158
llvm::MCFragment::FT_Org
@ FT_Org
Definition: MCFragment.h:42
llvm::numbers::e
constexpr double e
Definition: MathExtras.h:57
llvm::MCAssembler::getBundleAlignSize
unsigned getBundleAlignSize() const
Definition: MCAssembler.h:333
I
#define I(x, y, z)
Definition: MD5.cpp:59
StringExtras.h
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MCContext::reportError
void reportError(SMLoc L, const Twine &Msg)
Definition: MCContext.cpp:948
llvm::MCFragment::FT_SymbolId
@ FT_SymbolId
Definition: MCFragment.h:47
llvm::MCSymbol::isCommon
bool isCommon() const
Is this a 'common' symbol.
Definition: MCSymbol.h:379
llvm::MCFragment::FT_PseudoProbe
@ FT_PseudoProbe
Definition: MCFragment.h:50
llvm::MCSymbolRefExpr
Represent a reference to a symbol from inside an expression.
Definition: MCExpr.h:192
llvm::MCFragment::FT_Align
@ FT_Align
Definition: MCFragment.h:36
llvm::MCFragment::getKind
FragmentType getKind() const
Definition: MCFragment.h:94
MCSection.h
llvm::MCSection::isVirtualSection
virtual bool isVirtualSection() const =0
Check whether this section is "virtual", that is has no actual object file contents.
llvm::MCFragment::FT_Data
@ FT_Data
Definition: MCFragment.h:37
MCFixup.h
Compiler.h
llvm::MCSection
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::MCFragment::destroy
void destroy()
Destroys the current fragment.
Definition: MCFragment.cpp:262
llvm::MCAsmLayout::getFragmentOffset
uint64_t getFragmentOffset(const MCFragment *F) const
Get the offset of the given fragment inside its containing section.
Definition: MCFragment.cpp:96
MCAsmLayout.h
llvm::MCAsmLayout::MCAsmLayout
MCAsmLayout(MCAssembler &Assembler)
Definition: MCFragment.cpp:32
llvm::MCFragment::FT_Dwarf
@ FT_Dwarf
Definition: MCFragment.h:43
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:80
llvm::MCFragment::FT_Nops
@ FT_Nops
Definition: MCFragment.h:40
llvm::MCAsmLayout
Encapsulates the layout of an assembly file at a particular point in time.
Definition: MCAsmLayout.h:28
llvm::ilist_iterator
Iterator for intrusive lists based on ilist_node.
Definition: ilist_iterator.h:57
llvm::MCFixup::getKind
MCFixupKind getKind() const
Definition: MCFixup.h:130
Casting.h
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::MCAsmLayout::getSymbolOffset
bool getSymbolOffset(const MCSymbol &S, uint64_t &Val) const
Get the offset of the given symbol, as computed in the current layout.
Definition: MCFragment.cpp:148
MCValue.h
llvm::MCFragment::FT_Relaxable
@ FT_Relaxable
Definition: MCFragment.h:41
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:79
llvm::computeBundlePadding
uint64_t computeBundlePadding(const MCAssembler &Assembler, const MCEncodedFragment *F, uint64_t FOffset, uint64_t FSize)
Compute the amount of padding required before the fragment F to obey bundling restrictions,...
Definition: MCFragment.cpp:209
llvm::MCFragment::getLayoutOrder
unsigned getLayoutOrder() const
Definition: MCFragment.h:102
llvm::MCFragment::FT_Fill
@ FT_Fill
Definition: MCFragment.h:39
SmallVector.h
llvm::ilist_alloc_traits::deleteNode
static void deleteNode(NodeTy *V)
Definition: ilist.h:41
llvm::MCAsmLayout::canGetFragmentOffset
bool canGetFragmentOffset(const MCFragment *F) const
Definition: MCFragment.cpp:51
llvm::SmallVectorImpl< char >
llvm::HexStyle::Asm
@ Asm
0ffh
Definition: MCInstPrinter.h:34
llvm::MCAsmLayout::getAssembler
MCAssembler & getAssembler() const
Get the assembler object this is a layout for.
Definition: MCAsmLayout.h:50
llvm::MCValue
This represents an "assembler immediate".
Definition: MCValue.h:37
llvm::MCFragment::FT_Dummy
@ FT_Dummy
Definition: MCFragment.h:51
llvm::MCAsmLayout::getSectionAddressSize
uint64_t getSectionAddressSize(const MCSection *Sec) const
Get the address space size of the given section, as it effects layout.
Definition: MCFragment.cpp:194
raw_ostream.h
getLabelOffset
static bool getLabelOffset(const MCAsmLayout &Layout, const MCSymbol &S, bool ReportError, uint64_t &Val)
Definition: MCFragment.cpp:103
MCExpr.h
llvm::MCFixup
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:81
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
llvm::MCExpr::getLoc
SMLoc getLoc() const
Definition: MCExpr.h:82
llvm::MCFragment::FT_CompactEncodedInst
@ FT_CompactEncodedInst
Definition: MCFragment.h:38
llvm::MCFixup::getOffset
uint32_t getOffset() const
Definition: MCFixup.h:134