aboutsummaryrefslogtreecommitdiff
path: root/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
authorJan Wen Voung <jvoung@google.com>2010-09-30 05:59:22 +0000
committerJan Wen Voung <jvoung@google.com>2010-09-30 05:59:22 +0000
commit186e7a0fb1b2028e4fa9c3efe29d9433c91b3f66 (patch)
treedffdd5461c22f40aeb61afb3c80cef1ba8567648 /lib/MC/MCContext.cpp
parent1b6285cd72c480cd39048539d03b240e3c47d195 (diff)
Move logic of determining ELF entsize from the .s printer to initialization
time. That way, the EntrySize field is initialized for other code paths, namely, the .ll -> .o code path. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115141 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCContext.cpp')
-rw-r--r--lib/MC/MCContext.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/MC/MCContext.cpp b/lib/MC/MCContext.cpp
index e5586a0d7c..1e65f87792 100644
--- a/lib/MC/MCContext.cpp
+++ b/lib/MC/MCContext.cpp
@@ -160,6 +160,10 @@ getELFSection(StringRef Section, unsigned Type, unsigned Flags,
StringMapEntry<const MCSectionELF*> &Entry = Map.GetOrCreateValue(Section);
if (Entry.getValue()) return Entry.getValue();
+ // Possibly refine the entry size first.
+ if (!EntrySize) {
+ EntrySize = MCSectionELF::DetermineEntrySize(Kind);
+ }
MCSectionELF *Result = new (*this) MCSectionELF(Entry.getKey(), Type, Flags,
Kind, IsExplicit, EntrySize);
Entry.setValue(Result);