[cfe-commits] r41803 - in /cfe/trunk: Driver/ASTStreamers.cpp Parse/ParseObjc.cpp Parse/Parser.cpp Sema/SemaDecl.cpp clang.xcodeproj/project.pbxproj
Steve Naroff
snaroff at apple.com
Mon Sep 10 13:51:05 PDT 2007
Author: snaroff
Date: Mon Sep 10 15:51:04 2007
New Revision: 41803
URL: http://llvm.org/viewvc/llvm-project?rev=41803&view=rev
Log:
Some small tweaks to the recent Objc support...
Modified:
cfe/trunk/Driver/ASTStreamers.cpp
cfe/trunk/Parse/ParseObjc.cpp
cfe/trunk/Parse/Parser.cpp
cfe/trunk/Sema/SemaDecl.cpp
cfe/trunk/clang.xcodeproj/project.pbxproj
Modified: cfe/trunk/Driver/ASTStreamers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTStreamers.cpp?rev=41803&r1=41802&r2=41803&view=diff
==============================================================================
--- cfe/trunk/Driver/ASTStreamers.cpp (original)
+++ cfe/trunk/Driver/ASTStreamers.cpp Mon Sep 10 15:51:04 2007
@@ -99,6 +99,12 @@
fprintf(stderr, "typedef %s;\n", S.c_str());
}
+static void PrintObjcInterfaceDecl(ObjcInterfaceDecl *OID) {
+ std::string S = OID->getName();
+ fprintf(stderr, "@interface %s;\n", S.c_str());
+ // FIXME: implement the rest...
+}
+
void clang::PrintASTs(Preprocessor &PP, unsigned MainFileID, bool Stats) {
ASTContext Context(PP.getTargetInfo(), PP.getIdentifierTable());
ASTStreamerTy *Streamer = ASTStreamer_Init(PP, Context, MainFileID);
@@ -114,6 +120,8 @@
}
} else if (TypedefDecl *TD = dyn_cast<TypedefDecl>(D)) {
PrintTypeDefDecl(TD);
+ } else if (ObjcInterfaceDecl *OID = dyn_cast<ObjcInterfaceDecl>(D)) {
+ PrintObjcInterfaceDecl(OID);
} else {
fprintf(stderr, "Read top-level variable decl: '%s'\n", D->getName());
}
Modified: cfe/trunk/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseObjc.cpp?rev=41803&r1=41802&r2=41803&view=diff
==============================================================================
--- cfe/trunk/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/Parse/ParseObjc.cpp Mon Sep 10 15:51:04 2007
@@ -195,7 +195,7 @@
// The @ sign was already consumed by ParseObjCInterfaceDeclList().
if (Tok.isObjCAtKeyword(tok::objc_end)) {
ConsumeToken(); // the "end" identifier
- return 0;
+ return ClsType;
}
Diag(Tok, diag::err_objc_missing_end);
return 0;
@@ -370,7 +370,7 @@
DeclTy *MDecl = ParseObjCMethodDecl(methodType, methodLoc);
// Since this rule is used for both method declarations and definitions,
- // the caller is responsible for consuming the ';'.
+ // the caller is (optionally) responsible for consuming the ';'.
return MDecl;
}
Modified: cfe/trunk/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/Parser.cpp?rev=41803&r1=41802&r2=41803&view=diff
==============================================================================
--- cfe/trunk/Parse/Parser.cpp (original)
+++ cfe/trunk/Parse/Parser.cpp Mon Sep 10 15:51:04 2007
@@ -343,8 +343,7 @@
return 0;
case tok::at:
// @ is not a legal token unless objc is enabled, no need to check.
- ParseObjCAtDirectives();
- return 0;
+ return ParseObjCAtDirectives();
case tok::minus:
if (getLang().ObjC1) {
ParseObjCInstanceMethodDefinition();
@@ -549,6 +548,7 @@
// Ask the actions module to compute the type for this declarator.
Action::TypeResult TR =
Actions.ParseParamDeclaratorType(CurScope, ParmDeclarator);
+
if (!TR.isInvalid &&
// A missing identifier has already been diagnosed.
ParmDeclarator.getIdentifier()) {
Modified: cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaDecl.cpp?rev=41803&r1=41802&r2=41803&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/Sema/SemaDecl.cpp Mon Sep 10 15:51:04 2007
@@ -865,6 +865,7 @@
for (unsigned i = 0; i != NumElts; ++i) {
ObjcInterfaceDecl *IDecl;
+ // FIXME: before we create one, look up the interface decl in a hash table.
IDecl = new ObjcInterfaceDecl(SourceLocation(), IdentList[i], true);
// Chain & install the interface decl into the identifier.
IDecl->setNext(IdentList[i]->getFETokenInfo<Decl>());
Modified: cfe/trunk/clang.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/clang.xcodeproj/project.pbxproj?rev=41803&r1=41802&r2=41803&view=diff
==============================================================================
--- cfe/trunk/clang.xcodeproj/project.pbxproj (original)
+++ cfe/trunk/clang.xcodeproj/project.pbxproj Mon Sep 10 15:51:04 2007
@@ -671,7 +671,6 @@
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
- compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
projectDirPath = "";
More information about the cfe-commits
mailing list