summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCPureStreamer.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2013-08-09 01:52:03 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2013-08-09 01:52:03 +0000
commit4208b618587fddf163540b18f8b4893d1cd1ae26 (patch)
tree5c2e55b522aa1a2b33e9a7fe5395a2933be0c290 /llvm/lib/MC/MCPureStreamer.cpp
parentd7414e25dafda519bf2ab8932b5d43a1a4762dc5 (diff)
downloadbcm5719-llvm-4208b618587fddf163540b18f8b4893d1cd1ae26.tar.gz
bcm5719-llvm-4208b618587fddf163540b18f8b4893d1cd1ae26.zip
[CodeGen] prevent abnormal on invalid attributes
Currently, when an invalid attribute is encountered on processing a .s file, clang will abort due to llvm_unreachable. Invalid user input should not cause an abnormal termination of the compiler. Change the interface to return a boolean to indicate the failure as a first step towards improving hanlding of malformed user input to clang. Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org> llvm-svn: 188047
Diffstat (limited to 'llvm/lib/MC/MCPureStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCPureStreamer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCPureStreamer.cpp b/llvm/lib/MC/MCPureStreamer.cpp
index c5c3bb7055f..c6c772c6e2a 100644
--- a/llvm/lib/MC/MCPureStreamer.cpp
+++ b/llvm/lib/MC/MCPureStreamer.cpp
@@ -51,8 +51,9 @@ public:
virtual void FinishImpl();
- virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) {
+ virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) {
report_fatal_error("unsupported directive in pure streamer");
+ return false;
}
virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {
report_fatal_error("unsupported directive in pure streamer");
OpenPOWER on IntegriCloud