mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-30 07:14:53 +00:00
Simplify the code a bit: MCRelaxableFragment doesn't need a separate getInstSize
method because getContents().size() already covers it. So computeFragmentSize can use the generic MCEncodedFragment interface when querying both Data and Relaxable fragments for contents sizes. No change in functionality git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171903 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
02fa38344c
commit
0fdcef6030
@ -235,7 +235,6 @@ public:
|
||||
virtual SmallVectorImpl<char> &getContents() { return Contents; }
|
||||
virtual const SmallVectorImpl<char> &getContents() const { return Contents; }
|
||||
|
||||
unsigned getInstSize() const { return Contents.size(); }
|
||||
const MCInst &getInst() const { return Inst; }
|
||||
void setInst(const MCInst& Value) { Inst = Value; }
|
||||
|
||||
|
@ -387,11 +387,10 @@ uint64_t MCAssembler::computeFragmentSize(const MCAsmLayout &Layout,
|
||||
const MCFragment &F) const {
|
||||
switch (F.getKind()) {
|
||||
case MCFragment::FT_Data:
|
||||
return cast<MCDataFragment>(F).getContents().size();
|
||||
case MCFragment::FT_Relaxable:
|
||||
return cast<MCEncodedFragment>(F).getContents().size();
|
||||
case MCFragment::FT_Fill:
|
||||
return cast<MCFillFragment>(F).getSize();
|
||||
case MCFragment::FT_Relaxable:
|
||||
return cast<MCRelaxableFragment>(F).getInstSize();
|
||||
|
||||
case MCFragment::FT_LEB:
|
||||
return cast<MCLEBFragment>(F).getContents().size();
|
||||
|
Loading…
x
Reference in New Issue
Block a user