[llvm] r209309 - MC: loosen an overzealous assertion

Saleem Abdulrasool compnerd at compnerd.org
Wed May 21 19:30:52 PDT 2014


On Wed, May 21, 2014 at 11:18 AM, Benjamin Kramer <benny.kra at gmail.com>wrote:

>
> On 21.05.2014, at 19:53, Saleem Abdulrasool <compnerd at compnerd.org> wrote:
>
> > Author: compnerd
> > Date: Wed May 21 12:53:18 2014
> > New Revision: 209309
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=209309&view=rev
> > Log:
> > MC: loosen an overzealous assertion
> >
> > Permit active macro expansions when terminating the assembler if there
> were
> > errors during the expansion.  This would only trigger on invalid input
> when
> > built with assertions.
> >
> > Added:
> >    llvm/trunk/test/MC/AsmParser/invalid-input-assertion.s
> > Modified:
> >    llvm/trunk/lib/MC/MCParser/AsmParser.cpp
> >
> > Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=209309&r1=209308&r2=209309&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
> > +++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Wed May 21 12:53:18 2014
> > @@ -528,7 +528,8 @@ AsmParser::AsmParser(SourceMgr &_SM, MCC
> > }
> >
> > AsmParser::~AsmParser() {
> > -  assert(ActiveMacros.empty() && "Unexpected active macro
> instantiation!");
> > +  assert((HadError || ActiveMacros.empty()) &&
> > +         "Unexpected active macro instantiation!");
> >
> >   // Destroy any macros.
> >   for (StringMap<MCAsmMacro *>::iterator it = MacroMap.begin(),
> >
> > Added: llvm/trunk/test/MC/AsmParser/invalid-input-assertion.s
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/invalid-input-assertion.s?rev=209309&view=auto
> >
> ==============================================================================
> > --- llvm/trunk/test/MC/AsmParser/invalid-input-assertion.s (added)
> > +++ llvm/trunk/test/MC/AsmParser/invalid-input-assertion.s Wed May 21
> 12:53:18 2014
> > @@ -0,0 +1,10 @@
> > +// RUN: not llvm-mc -triple i686-linux -o /dev/null %s
> > +// REQUIRES: asserts
>
> Why does this test require assertions?
>

The test is to ensure that the driver doesn't crash due to the assertion.
 The actual handling of it wasn't changed.  I could be convinced that the
test doesn't add much though.


> - Ben
>
> > +
> > +     .macro macro parameter=0
> > +             .if \parameter
> > +             .else
> > +     .endm
> > +
> > +     macro 1
> > +
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>


-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140521/067b8e0f/attachment.html>


More information about the llvm-commits mailing list