[cfe-commits] r115004 - in /cfe/trunk: lib/Parse/ParseTentative.cpp test/Parser/MicrosoftExtensions.c

Chris Lattner sabre at nondot.org
Tue Sep 28 16:35:09 PDT 2010


Author: lattner
Date: Tue Sep 28 18:35:09 2010
New Revision: 115004

URL: http://llvm.org/viewvc/llvm-project?rev=115004&view=rev
Log:
enhance tentative parsing to handle ms extensions, patch by Martin Vejnar!

Modified:
    cfe/trunk/lib/Parse/ParseTentative.cpp
    cfe/trunk/test/Parser/MicrosoftExtensions.c

Modified: cfe/trunk/lib/Parse/ParseTentative.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTentative.cpp?rev=115004&r1=115003&r2=115004&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTentative.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTentative.cpp Tue Sep 28 18:35:09 2010
@@ -532,7 +532,12 @@
       // '(' declarator ')'
       // '(' attributes declarator ')'
       // '(' abstract-declarator ')'
-      if (Tok.is(tok::kw___attribute))
+      if (Tok.is(tok::kw___attribute) ||
+          Tok.is(tok::kw___declspec) ||
+          Tok.is(tok::kw___cdecl) ||
+          Tok.is(tok::kw___stdcall) ||
+          Tok.is(tok::kw___fastcall) ||
+          Tok.is(tok::kw___thiscall))
         return TPResult::True(); // attributes indicate declaration
       TPResult TPR = TryParseDeclarator(mayBeAbstract, mayHaveIdentifier);
       if (TPR != TPResult::Ambiguous())

Modified: cfe/trunk/test/Parser/MicrosoftExtensions.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.c?rev=115004&r1=115003&r2=115004&view=diff
==============================================================================
--- cfe/trunk/test/Parser/MicrosoftExtensions.c (original)
+++ cfe/trunk/test/Parser/MicrosoftExtensions.c Tue Sep 28 18:35:09 2010
@@ -30,6 +30,10 @@
 
 typedef bool (__stdcall __stdcall *blarg)(int);
 
+void local_callconv()
+{
+  bool (__stdcall *p)(int);
+}
 
 // Charify extension.
 #define FOO(x) #@x





More information about the cfe-commits mailing list