aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-01-30 14:23:32 +0000
committerSteve Naroff <snaroff@apple.com>2009-01-30 14:23:32 +0000
commitf64ef62699ae470437d3689888cb284fd31e9bd9 (patch)
tree9b2b2edf8a2f1c6153e96d7b83476cb3d6b49386 /lib/Parse/ParseDecl.cpp
parent2612903c0b83af6c2b0268797dff340174eef55f (diff)
Simplify/cleanup r63219 (based on Chris review).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63393 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 7b6d8f8185..cc1e9970e9 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -1993,25 +1993,13 @@ void Parser::ParseFunctionDeclarator(SourceLocation LParenLoc, Declarator &D,
// Alternatively, this parameter list may be an identifier list form for a
// K&R-style function: void foo(a,b,c)
if (!getLang().CPlusPlus && Tok.is(tok::identifier)) {
-
- TypeTy *TypeRep = Actions.getTypeName(*Tok.getIdentifierInfo(), CurScope);
- if (TypeRep) {
- // This is a typename. Replace the current token in-place with an
- // annotation type token.
- Tok.setKind(tok::annot_typename);
- Tok.setAnnotationValue(TypeRep);
- Tok.setAnnotationEndLoc(Tok.getLocation());
- // In case the tokens were cached, have Preprocessor replace
- // them with the annotation token.
- PP.AnnotateCachedTokens(Tok);
- } else {
+ if (!TryAnnotateTypeOrScopeToken()) {
// K&R identifier lists can't have typedefs as identifiers, per
// C99 6.7.5.3p11.
if (RequiresArg) {
Diag(Tok, diag::err_argument_required_after_attribute);
delete AttrList;
}
-
// Identifier list. Note that '(' identifier-list ')' is only allowed for
// normal declarators, not for abstract-declarators.
return ParseFunctionDeclaratorIdentifierList(LParenLoc, D);