summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-01-07 03:13:18 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-01-07 03:13:18 +0000
commit99b4237c1647156f0e1d3d7e03efdab23ed79778 (patch)
treed42c2ee376e2ae4534420e024205edc6b7cca8fe /include
parent977679d6034791fd48a344e5b990503ba50fc242 (diff)
downloadllvm-99b4237c1647156f0e1d3d7e03efdab23ed79778.tar.gz
llvm-99b4237c1647156f0e1d3d7e03efdab23ed79778.tar.bz2
llvm-99b4237c1647156f0e1d3d7e03efdab23ed79778.tar.xz
Split Finish into Finish and FinishImpl to have a common place to do end of
file error checking. Use that to error on an unfinished cfi_startproc. The error is not nice, but is already better than a segmentation fault. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147717 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCExpr.h4
-rw-r--r--include/llvm/MC/MCObjectStreamer.h2
-rw-r--r--include/llvm/MC/MCStreamer.h4
3 files changed, 7 insertions, 3 deletions
diff --git a/include/llvm/MC/MCExpr.h b/include/llvm/MC/MCExpr.h
index 195762e64b..6f156b2844 100644
--- a/include/llvm/MC/MCExpr.h
+++ b/include/llvm/MC/MCExpr.h
@@ -204,7 +204,9 @@ private:
const VariantKind Kind;
explicit MCSymbolRefExpr(const MCSymbol *_Symbol, VariantKind _Kind)
- : MCExpr(MCExpr::SymbolRef), Symbol(_Symbol), Kind(_Kind) {}
+ : MCExpr(MCExpr::SymbolRef), Symbol(_Symbol), Kind(_Kind) {
+ assert(Symbol);
+ }
public:
/// @name Construction
diff --git a/include/llvm/MC/MCObjectStreamer.h b/include/llvm/MC/MCObjectStreamer.h
index 01d254a49c..deed1cafb1 100644
--- a/include/llvm/MC/MCObjectStreamer.h
+++ b/include/llvm/MC/MCObjectStreamer.h
@@ -78,7 +78,7 @@ public:
virtual void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
const MCSymbol *Label);
virtual void EmitGPRel32Value(const MCExpr *Value);
- virtual void Finish();
+ virtual void FinishImpl();
/// @}
};
diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h
index e550dfa3ef..e227c485fb 100644
--- a/include/llvm/MC/MCStreamer.h
+++ b/include/llvm/MC/MCStreamer.h
@@ -590,8 +590,10 @@ namespace llvm {
virtual void EmitRegSave(const SmallVectorImpl<unsigned> &RegList,
bool isVector);
+ /// FinishImpl - Streamer specific finalization.
+ virtual void FinishImpl() = 0;
/// Finish - Finish emission of machine code.
- virtual void Finish() = 0;
+ void Finish();
};
/// createNullStreamer - Create a dummy machine code streamer, which does