aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCNullStreamer.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/MCNullStreamer.cpp
parentd7414e25dafda519bf2ab8932b5d43a1a4762dc5 (diff)
downloadllvm-4208b618587fddf163540b18f8b4893d1cd1ae26.zip
llvm-4208b618587fddf163540b18f8b4893d1cd1ae26.tar.gz
llvm-4208b618587fddf163540b18f8b4893d1cd1ae26.tar.bz2
[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/MCNullStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCNullStreamer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCNullStreamer.cpp b/llvm/lib/MC/MCNullStreamer.cpp
index 530c646..87a7db6 100644
--- a/llvm/lib/MC/MCNullStreamer.cpp
+++ b/llvm/lib/MC/MCNullStreamer.cpp
@@ -52,7 +52,9 @@ namespace {
const MCSymbol *Label,
unsigned PointerSize) {}
- virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute){}
+ virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute){
+ return true;
+ }
virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}