aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCAssembler.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-06-01 14:34:40 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-06-01 14:34:40 +0000
commit499c99c2296d85617f274cca1ec53cc5e6367345 (patch)
treeeff33331aff092f712eff61f1f7feeba234a30af /llvm/lib/MC/MCAssembler.cpp
parentf6289f24f7fb806b598151a812a4cc4985405723 (diff)
downloadllvm-499c99c2296d85617f274cca1ec53cc5e6367345.zip
llvm-499c99c2296d85617f274cca1ec53cc5e6367345.tar.gz
llvm-499c99c2296d85617f274cca1ec53cc5e6367345.tar.bz2
The fragment implies the section, don't store both.
This reduces MCSymbol from 64 to 56 bytes on x86_64. llvm-svn: 238747
Diffstat (limited to 'llvm/lib/MC/MCAssembler.cpp')
-rw-r--r--llvm/lib/MC/MCAssembler.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index 7f09e74..087caae 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -579,6 +579,16 @@ static void writeFragmentContents(const MCFragment &F, MCObjectWriter *OW) {
OW->WriteBytes(EF.getContents());
}
+void MCAssembler::registerSymbol(const MCSymbol &Symbol, bool *Created) {
+ bool New = !Symbol.isRegistered();
+ if (Created)
+ *Created = New;
+ if (New) {
+ Symbol.setIsRegistered(true);
+ Symbols.push_back(&Symbol);
+ }
+}
+
void MCAssembler::writeFragmentPadding(const MCFragment &F, uint64_t FSize,
MCObjectWriter *OW) const {
// Should NOP padding be written out before this fragment?