summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCStreamer.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-10-03 00:18:14 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-10-03 00:18:14 +0000
commit2f834372f49f5665ab8032c575c4f4d76d97da84 (patch)
tree234490db2c6f3baf2120c436c84fede7316c0e61 /llvm/lib/MC/MCStreamer.cpp
parent21ea9bdc46a2dc09482f7373246fa8e5fd3a38b5 (diff)
downloadbcm5719-llvm-2f834372f49f5665ab8032c575c4f4d76d97da84.tar.gz
bcm5719-llvm-2f834372f49f5665ab8032c575c4f4d76d97da84.zip
Disallow assigning symbol a null section.
They are constructed without one and they can't go back, so this was effectively dead code. llvm-svn: 249220
Diffstat (limited to 'llvm/lib/MC/MCStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCStreamer.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index 57782eaaefc..d6b44a0297d 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -189,10 +189,8 @@ void MCStreamer::InitSections(bool NoExecStack) {
}
void MCStreamer::AssignSection(MCSymbol *Symbol, MCSection *Section) {
- if (Section)
- Symbol->setSection(*Section);
- else
- Symbol->setUndefined();
+ assert(Section);
+ Symbol->setSection(*Section);
// As we emit symbols into a section, track the order so that they can
// be sorted upon later. Zero is reserved to mean 'unemitted'.
OpenPOWER on IntegriCloud