[cfe-commits] r39242 - in /cfe/cfe/trunk: AST/SemaDecl.cpp Parse/Parser.cpp Sema/SemaDecl.cpp
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:41:47 PDT 2007
Author: sabre
Date: Wed Jul 11 11:41:47 2007
New Revision: 39242
URL: http://llvm.org/viewvc/llvm-project?rev=39242&view=rev
Log:
add some comments
Modified:
cfe/cfe/trunk/AST/SemaDecl.cpp
cfe/cfe/trunk/Parse/Parser.cpp
cfe/cfe/trunk/Sema/SemaDecl.cpp
Modified: cfe/cfe/trunk/AST/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/SemaDecl.cpp?rev=39242&r1=39241&r2=39242&view=diff
==============================================================================
--- cfe/cfe/trunk/AST/SemaDecl.cpp (original)
+++ cfe/cfe/trunk/AST/SemaDecl.cpp Wed Jul 11 11:41:47 2007
@@ -76,9 +76,9 @@
}
Decl *New;
- if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef) {
+ if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef)
New = ParseTypedefDecl(S, D, PrevDecl);
- } else if (D.isFunctionDeclarator())
+ else if (D.isFunctionDeclarator())
New = new FunctionDecl(II, GetTypeForDeclarator(D, S), PrevDecl);
else
New = new VarDecl(II, GetTypeForDeclarator(D, S), PrevDecl);
@@ -126,11 +126,20 @@
// Since this is a function definition, act as though we have information
// about the arguments.
FTI.hasPrototype = true;
+ } else {
+ // FIXME: Diagnose arguments without names in C.
+
}
-
FunctionDecl *FD = static_cast<FunctionDecl*>(ParseDeclarator(S, D, 0, 0));
CurFunctionDecl = FD;
+
+ // Since this is a function definition, remember the names of the arguments in
+ // the FunctionDecl.
+
+ // FIXME: TODO. Add to FunctionDecl, install declarators into current scope.
+
+
return FD;
}
Modified: cfe/cfe/trunk/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/Parser.cpp?rev=39242&r1=39241&r2=39242&view=diff
==============================================================================
--- cfe/cfe/trunk/Parse/Parser.cpp (original)
+++ cfe/cfe/trunk/Parse/Parser.cpp Wed Jul 11 11:41:47 2007
@@ -413,8 +413,8 @@
// Enter a scope for the function body.
EnterScope(Scope::FnScope);
-
-
+ // Tell the actions module that we have entered a function definition with the
+ // specified Declarator for the function.
DeclTy *Res = Actions.ParseStartOfFunctionDef(CurScope, D);
Modified: cfe/cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaDecl.cpp?rev=39242&r1=39241&r2=39242&view=diff
==============================================================================
--- cfe/cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaDecl.cpp Wed Jul 11 11:41:47 2007
@@ -76,9 +76,9 @@
}
Decl *New;
- if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef) {
+ if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef)
New = ParseTypedefDecl(S, D, PrevDecl);
- } else if (D.isFunctionDeclarator())
+ else if (D.isFunctionDeclarator())
New = new FunctionDecl(II, GetTypeForDeclarator(D, S), PrevDecl);
else
New = new VarDecl(II, GetTypeForDeclarator(D, S), PrevDecl);
@@ -126,11 +126,20 @@
// Since this is a function definition, act as though we have information
// about the arguments.
FTI.hasPrototype = true;
+ } else {
+ // FIXME: Diagnose arguments without names in C.
+
}
-
FunctionDecl *FD = static_cast<FunctionDecl*>(ParseDeclarator(S, D, 0, 0));
CurFunctionDecl = FD;
+
+ // Since this is a function definition, remember the names of the arguments in
+ // the FunctionDecl.
+
+ // FIXME: TODO. Add to FunctionDecl, install declarators into current scope.
+
+
return FD;
}
More information about the cfe-commits
mailing list