aboutsummaryrefslogtreecommitdiff
path: root/llvm/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
commitefbdbe5565edd457cc39b9317e9ba677bf6b2f6c (patch)
tree8b83a3eefc642393ced04e55af765d096e8b4672 /llvm/lib/MC/MCContext.cpp
parent9d98ac645e32a304f429a8aa39f0e5db8417b95a (diff)
downloadllvm-efbdbe5565edd457cc39b9317e9ba677bf6b2f6c.zip
llvm-efbdbe5565edd457cc39b9317e9ba677bf6b2f6c.tar.gz
llvm-efbdbe5565edd457cc39b9317e9ba677bf6b2f6c.tar.bz2
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. llvm-svn: 115141
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r--llvm/lib/MC/MCContext.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index e5586a0..1e65f877 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/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);