diff options
author | Eli Bendersky <eliben@google.com> | 2013-01-08 22:05:10 +0000 |
---|---|---|
committer | Eli Bendersky <eliben@google.com> | 2013-01-08 22:05:10 +0000 |
commit | 0fdcef6030fb69bee45f604c71c53bebb17c1079 (patch) | |
tree | ce6828b81d0d3a0dea0343134c860350fa2f3276 /lib/MC | |
parent | 02fa38344c1cf1f27d59da5c3358d19bbb752f01 (diff) | |
download | external_llvm-0fdcef6030fb69bee45f604c71c53bebb17c1079.zip external_llvm-0fdcef6030fb69bee45f604c71c53bebb17c1079.tar.gz external_llvm-0fdcef6030fb69bee45f604c71c53bebb17c1079.tar.bz2 |
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
Diffstat (limited to 'lib/MC')
-rw-r--r-- | lib/MC/MCAssembler.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp index ee5ac1d..5fdc57a 100644 --- a/lib/MC/MCAssembler.cpp +++ b/lib/MC/MCAssembler.cpp @@ -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(); |