зеркало из https://github.com/microsoft/clang-1.git
convert tabs to spaces, patch by Mike Stump!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47560 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
2083a91d59
Коммит
c81c8144a6
92
AST/Decl.cpp
92
AST/Decl.cpp
|
@ -95,79 +95,79 @@ bool Decl::CollectingStats(bool enable) {
|
|||
void Decl::PrintStats() {
|
||||
fprintf(stderr, "*** Decl Stats:\n");
|
||||
fprintf(stderr, " %d decls total.\n",
|
||||
int(nFuncs+nBlockVars+nFileVars+nParmVars+nFieldDecls+nSUC+
|
||||
nEnumDecls+nEnumConst+nTypedef+nInterfaceDecls+nClassDecls+
|
||||
nMethodDecls+nProtocolDecls+nCategoryDecls+nIvarDecls));
|
||||
int(nFuncs+nBlockVars+nFileVars+nParmVars+nFieldDecls+nSUC+
|
||||
nEnumDecls+nEnumConst+nTypedef+nInterfaceDecls+nClassDecls+
|
||||
nMethodDecls+nProtocolDecls+nCategoryDecls+nIvarDecls));
|
||||
fprintf(stderr, " %d function decls, %d each (%d bytes)\n",
|
||||
nFuncs, (int)sizeof(FunctionDecl), int(nFuncs*sizeof(FunctionDecl)));
|
||||
nFuncs, (int)sizeof(FunctionDecl), int(nFuncs*sizeof(FunctionDecl)));
|
||||
fprintf(stderr, " %d block variable decls, %d each (%d bytes)\n",
|
||||
nBlockVars, (int)sizeof(BlockVarDecl),
|
||||
int(nBlockVars*sizeof(BlockVarDecl)));
|
||||
nBlockVars, (int)sizeof(BlockVarDecl),
|
||||
int(nBlockVars*sizeof(BlockVarDecl)));
|
||||
fprintf(stderr, " %d file variable decls, %d each (%d bytes)\n",
|
||||
nFileVars, (int)sizeof(FileVarDecl),
|
||||
int(nFileVars*sizeof(FileVarDecl)));
|
||||
nFileVars, (int)sizeof(FileVarDecl),
|
||||
int(nFileVars*sizeof(FileVarDecl)));
|
||||
fprintf(stderr, " %d parameter variable decls, %d each (%d bytes)\n",
|
||||
nParmVars, (int)sizeof(ParmVarDecl),
|
||||
int(nParmVars*sizeof(ParmVarDecl)));
|
||||
nParmVars, (int)sizeof(ParmVarDecl),
|
||||
int(nParmVars*sizeof(ParmVarDecl)));
|
||||
fprintf(stderr, " %d field decls, %d each (%d bytes)\n",
|
||||
nFieldDecls, (int)sizeof(FieldDecl),
|
||||
int(nFieldDecls*sizeof(FieldDecl)));
|
||||
nFieldDecls, (int)sizeof(FieldDecl),
|
||||
int(nFieldDecls*sizeof(FieldDecl)));
|
||||
fprintf(stderr, " %d struct/union/class decls, %d each (%d bytes)\n",
|
||||
nSUC, (int)sizeof(RecordDecl),
|
||||
int(nSUC*sizeof(RecordDecl)));
|
||||
nSUC, (int)sizeof(RecordDecl),
|
||||
int(nSUC*sizeof(RecordDecl)));
|
||||
fprintf(stderr, " %d enum decls, %d each (%d bytes)\n",
|
||||
nEnumDecls, (int)sizeof(EnumDecl),
|
||||
int(nEnumDecls*sizeof(EnumDecl)));
|
||||
nEnumDecls, (int)sizeof(EnumDecl),
|
||||
int(nEnumDecls*sizeof(EnumDecl)));
|
||||
fprintf(stderr, " %d enum constant decls, %d each (%d bytes)\n",
|
||||
nEnumConst, (int)sizeof(EnumConstantDecl),
|
||||
int(nEnumConst*sizeof(EnumConstantDecl)));
|
||||
nEnumConst, (int)sizeof(EnumConstantDecl),
|
||||
int(nEnumConst*sizeof(EnumConstantDecl)));
|
||||
fprintf(stderr, " %d typedef decls, %d each (%d bytes)\n",
|
||||
nTypedef, (int)sizeof(TypedefDecl),int(nTypedef*sizeof(TypedefDecl)));
|
||||
nTypedef, (int)sizeof(TypedefDecl),int(nTypedef*sizeof(TypedefDecl)));
|
||||
// Objective-C decls...
|
||||
fprintf(stderr, " %d interface decls, %d each (%d bytes)\n",
|
||||
nInterfaceDecls, (int)sizeof(ObjCInterfaceDecl),
|
||||
int(nInterfaceDecls*sizeof(ObjCInterfaceDecl)));
|
||||
nInterfaceDecls, (int)sizeof(ObjCInterfaceDecl),
|
||||
int(nInterfaceDecls*sizeof(ObjCInterfaceDecl)));
|
||||
fprintf(stderr, " %d instance variable decls, %d each (%d bytes)\n",
|
||||
nIvarDecls, (int)sizeof(ObjCIvarDecl),
|
||||
int(nIvarDecls*sizeof(ObjCIvarDecl)));
|
||||
nIvarDecls, (int)sizeof(ObjCIvarDecl),
|
||||
int(nIvarDecls*sizeof(ObjCIvarDecl)));
|
||||
fprintf(stderr, " %d class decls, %d each (%d bytes)\n",
|
||||
nClassDecls, (int)sizeof(ObjCClassDecl),
|
||||
int(nClassDecls*sizeof(ObjCClassDecl)));
|
||||
nClassDecls, (int)sizeof(ObjCClassDecl),
|
||||
int(nClassDecls*sizeof(ObjCClassDecl)));
|
||||
fprintf(stderr, " %d method decls, %d each (%d bytes)\n",
|
||||
nMethodDecls, (int)sizeof(ObjCMethodDecl),
|
||||
int(nMethodDecls*sizeof(ObjCMethodDecl)));
|
||||
nMethodDecls, (int)sizeof(ObjCMethodDecl),
|
||||
int(nMethodDecls*sizeof(ObjCMethodDecl)));
|
||||
fprintf(stderr, " %d protocol decls, %d each (%d bytes)\n",
|
||||
nProtocolDecls, (int)sizeof(ObjCProtocolDecl),
|
||||
int(nProtocolDecls*sizeof(ObjCProtocolDecl)));
|
||||
nProtocolDecls, (int)sizeof(ObjCProtocolDecl),
|
||||
int(nProtocolDecls*sizeof(ObjCProtocolDecl)));
|
||||
fprintf(stderr, " %d forward protocol decls, %d each (%d bytes)\n",
|
||||
nForwardProtocolDecls, (int)sizeof(ObjCForwardProtocolDecl),
|
||||
int(nForwardProtocolDecls*sizeof(ObjCForwardProtocolDecl)));
|
||||
nForwardProtocolDecls, (int)sizeof(ObjCForwardProtocolDecl),
|
||||
int(nForwardProtocolDecls*sizeof(ObjCForwardProtocolDecl)));
|
||||
fprintf(stderr, " %d category decls, %d each (%d bytes)\n",
|
||||
nCategoryDecls, (int)sizeof(ObjCCategoryDecl),
|
||||
int(nCategoryDecls*sizeof(ObjCCategoryDecl)));
|
||||
nCategoryDecls, (int)sizeof(ObjCCategoryDecl),
|
||||
int(nCategoryDecls*sizeof(ObjCCategoryDecl)));
|
||||
|
||||
fprintf(stderr, " %d class implementation decls, %d each (%d bytes)\n",
|
||||
nObjCImplementationDecls, (int)sizeof(ObjCImplementationDecl),
|
||||
int(nObjCImplementationDecls*sizeof(ObjCImplementationDecl)));
|
||||
nObjCImplementationDecls, (int)sizeof(ObjCImplementationDecl),
|
||||
int(nObjCImplementationDecls*sizeof(ObjCImplementationDecl)));
|
||||
|
||||
fprintf(stderr, " %d class implementation decls, %d each (%d bytes)\n",
|
||||
nObjCCategoryImpl, (int)sizeof(ObjCCategoryImplDecl),
|
||||
int(nObjCCategoryImpl*sizeof(ObjCCategoryImplDecl)));
|
||||
nObjCCategoryImpl, (int)sizeof(ObjCCategoryImplDecl),
|
||||
int(nObjCCategoryImpl*sizeof(ObjCCategoryImplDecl)));
|
||||
|
||||
fprintf(stderr, " %d compatibility alias decls, %d each (%d bytes)\n",
|
||||
nObjCCompatibleAlias, (int)sizeof(ObjCCompatibleAliasDecl),
|
||||
int(nObjCCompatibleAlias*sizeof(ObjCCompatibleAliasDecl)));
|
||||
nObjCCompatibleAlias, (int)sizeof(ObjCCompatibleAliasDecl),
|
||||
int(nObjCCompatibleAlias*sizeof(ObjCCompatibleAliasDecl)));
|
||||
|
||||
fprintf(stderr, " %d property decls, %d each (%d bytes)\n",
|
||||
nObjCPropertyDecl, (int)sizeof(ObjCPropertyDecl),
|
||||
int(nObjCPropertyDecl*sizeof(ObjCPropertyDecl)));
|
||||
nObjCPropertyDecl, (int)sizeof(ObjCPropertyDecl),
|
||||
int(nObjCPropertyDecl*sizeof(ObjCPropertyDecl)));
|
||||
|
||||
fprintf(stderr, "Total bytes = %d\n",
|
||||
int(nFuncs*sizeof(FunctionDecl)+nBlockVars*sizeof(BlockVarDecl)+
|
||||
nFileVars*sizeof(FileVarDecl)+nParmVars*sizeof(ParmVarDecl)+
|
||||
nFieldDecls*sizeof(FieldDecl)+nSUC*sizeof(RecordDecl)+
|
||||
nEnumDecls*sizeof(EnumDecl)+nEnumConst*sizeof(EnumConstantDecl)+
|
||||
nTypedef*sizeof(TypedefDecl)+
|
||||
int(nFuncs*sizeof(FunctionDecl)+nBlockVars*sizeof(BlockVarDecl)+
|
||||
nFileVars*sizeof(FileVarDecl)+nParmVars*sizeof(ParmVarDecl)+
|
||||
nFieldDecls*sizeof(FieldDecl)+nSUC*sizeof(RecordDecl)+
|
||||
nEnumDecls*sizeof(EnumDecl)+nEnumConst*sizeof(EnumConstantDecl)+
|
||||
nTypedef*sizeof(TypedefDecl)+
|
||||
nInterfaceDecls*sizeof(ObjCInterfaceDecl)+
|
||||
nIvarDecls*sizeof(ObjCIvarDecl)+
|
||||
nClassDecls*sizeof(ObjCClassDecl)+
|
||||
|
|
|
@ -70,7 +70,7 @@ void DeclPrinter:: PrintDecl(Decl *D) {
|
|||
} else if (ObjCProtocolDecl *PID = dyn_cast<ObjCProtocolDecl>(D)) {
|
||||
PrintObjCProtocolDecl(PID);
|
||||
} else if (ObjCForwardProtocolDecl *OFPD =
|
||||
dyn_cast<ObjCForwardProtocolDecl>(D)) {
|
||||
dyn_cast<ObjCForwardProtocolDecl>(D)) {
|
||||
Out << "@protocol ";
|
||||
for (unsigned i = 0, e = OFPD->getNumForwardDecls(); i != e; ++i) {
|
||||
const ObjCProtocolDecl *D = OFPD->getForwardProtocolDecl(i);
|
||||
|
@ -79,16 +79,16 @@ void DeclPrinter:: PrintDecl(Decl *D) {
|
|||
}
|
||||
Out << ";\n";
|
||||
} else if (ObjCImplementationDecl *OID =
|
||||
dyn_cast<ObjCImplementationDecl>(D)) {
|
||||
dyn_cast<ObjCImplementationDecl>(D)) {
|
||||
PrintObjCImplementationDecl(OID);
|
||||
} else if (ObjCCategoryImplDecl *OID =
|
||||
dyn_cast<ObjCCategoryImplDecl>(D)) {
|
||||
dyn_cast<ObjCCategoryImplDecl>(D)) {
|
||||
PrintObjCCategoryImplDecl(OID);
|
||||
} else if (ObjCCategoryDecl *OID =
|
||||
dyn_cast<ObjCCategoryDecl>(D)) {
|
||||
dyn_cast<ObjCCategoryDecl>(D)) {
|
||||
PrintObjCCategoryDecl(OID);
|
||||
} else if (ObjCCompatibleAliasDecl *OID =
|
||||
dyn_cast<ObjCCompatibleAliasDecl>(D)) {
|
||||
dyn_cast<ObjCCompatibleAliasDecl>(D)) {
|
||||
PrintObjCCompatibleAliasDecl(OID);
|
||||
} else if (isa<ObjCClassDecl>(D)) {
|
||||
Out << "@class [printing todo]\n";
|
||||
|
|
|
@ -887,7 +887,7 @@ static void InitializeIncludePaths(HeaderSearch &Headers, FileManager &FM,
|
|||
|
||||
// Ubuntu 7.10 - Gutsy Gibbon
|
||||
AddPath("/usr/lib/gcc/i486-linux-gnu/4.1.3/include", System,
|
||||
false, false, false, Headers);
|
||||
false, false, false, Headers);
|
||||
|
||||
AddPath("/usr/include", System, false, false, false, Headers);
|
||||
AddPath("/System/Library/Frameworks", System, true, false, true, Headers);
|
||||
|
|
|
@ -770,7 +770,7 @@ void Parser::ParseStructUnionBody(SourceLocation RecordLoc,
|
|||
SourceLocation RBraceLoc = MatchRHSPunctuation(tok::r_brace, LBraceLoc);
|
||||
|
||||
Actions.ActOnFields(CurScope,
|
||||
RecordLoc,TagDecl,&FieldDecls[0],FieldDecls.size(),
|
||||
RecordLoc,TagDecl,&FieldDecls[0],FieldDecls.size(),
|
||||
LBraceLoc, RBraceLoc);
|
||||
|
||||
AttributeList *AttrList = 0;
|
||||
|
|
|
@ -1715,11 +1715,11 @@ Sema::DeclTy *Sema::ActOnFileScopeAsmDecl(SourceLocation Loc,
|
|||
}
|
||||
|
||||
Sema::DeclTy* Sema::ActOnLinkageSpec(SourceLocation Loc,
|
||||
SourceLocation LBrace,
|
||||
SourceLocation RBrace,
|
||||
const char *Lang,
|
||||
unsigned StrSize,
|
||||
DeclTy *D) {
|
||||
SourceLocation LBrace,
|
||||
SourceLocation RBrace,
|
||||
const char *Lang,
|
||||
unsigned StrSize,
|
||||
DeclTy *D) {
|
||||
LinkageSpecDecl::LanguageIDs Language;
|
||||
Decl *dcl = static_cast<Decl *>(D);
|
||||
if (strncmp(Lang, "\"C\"", StrSize) == 0)
|
||||
|
|
|
@ -382,7 +382,7 @@ Sema::DeclTy *Sema::ActOnStartClassImplementation(
|
|||
// Legacy case of @implementation with no corresponding @interface.
|
||||
// Build, chain & install the interface decl into the identifier.
|
||||
IDecl = new ObjCInterfaceDecl(AtClassImplLoc, 0, ClassName,
|
||||
false, true);
|
||||
false, true);
|
||||
IDecl->setNext(ClassName->getFETokenInfo<ScopedDecl>());
|
||||
ClassName->setFETokenInfo(IDecl);
|
||||
IDecl->setSuperClass(SDecl);
|
||||
|
|
|
@ -275,11 +275,11 @@ Sema::ExprResult Sema::ActOnInstanceMessage(
|
|||
if (ObjCImplementationDecl *ImpDecl =
|
||||
ObjCImplementations[ClassDecl->getIdentifier()])
|
||||
Method = ImpDecl->getInstanceMethod(Sel);
|
||||
// If we still haven't found a method, look in the global pool. This
|
||||
// behavior isn't very desirable, however we need it for GCC
|
||||
// If we still haven't found a method, look in the global pool. This
|
||||
// behavior isn't very desirable, however we need it for GCC
|
||||
// compatibility.
|
||||
if (!Method)
|
||||
Method = InstanceMethodPool[Sel].Method;
|
||||
if (!Method)
|
||||
Method = InstanceMethodPool[Sel].Method;
|
||||
}
|
||||
if (!Method) {
|
||||
Diag(lbrac, diag::warn_method_not_found, std::string("-"), Sel.getName(),
|
||||
|
|
|
@ -224,7 +224,7 @@ public:
|
|||
|
||||
// Return the ObjC type encoding for a given type.
|
||||
void getObjCEncodingForType(QualType t, std::string &S,
|
||||
llvm::SmallVector<const RecordType *, 8> &RT) const;
|
||||
llvm::SmallVector<const RecordType *, 8> &RT) const;
|
||||
|
||||
// Put the string version of type qualifiers into S.
|
||||
void getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT,
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
ObjCMethod,
|
||||
ObjCClass,
|
||||
ObjCForwardProtocol,
|
||||
LinkageSpec,
|
||||
LinkageSpec,
|
||||
FileScopeAsm,
|
||||
|
||||
// For each non-leaf class, we now define a mapping to the first/last member
|
||||
|
@ -678,7 +678,7 @@ public:
|
|||
EnumDecl(SourceLocation L, IdentifierInfo *Id, ScopedDecl *PrevDecl)
|
||||
: TagDecl(Enum, L, Id, PrevDecl) {
|
||||
ElementList = 0;
|
||||
IntegerType = QualType();
|
||||
IntegerType = QualType();
|
||||
}
|
||||
|
||||
/// defineElements - When created, EnumDecl correspond to a forward declared
|
||||
|
@ -804,7 +804,7 @@ public:
|
|||
/// ensure a stable abi for this, we choose the DW_LANG_ encodings
|
||||
/// from the dwarf standard.
|
||||
enum LanguageIDs { lang_c = /* DW_LANG_C */ 0x0002,
|
||||
lang_cxx = /* DW_LANG_C_plus_plus */ 0x0004 };
|
||||
lang_cxx = /* DW_LANG_C_plus_plus */ 0x0004 };
|
||||
private:
|
||||
/// Language - The language for this linkage specification.
|
||||
LanguageIDs Language;
|
||||
|
|
|
@ -295,24 +295,24 @@ public:
|
|||
}
|
||||
ObjCIvarDecl *lookupInstanceVariable(IdentifierInfo *ivarName,
|
||||
ObjCInterfaceDecl *&clsDeclared);
|
||||
|
||||
|
||||
// Get the local instance method declared in this interface.
|
||||
ObjCMethodDecl *getInstanceMethod(Selector &Sel) {
|
||||
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end();
|
||||
I != E; ++I) {
|
||||
I != E; ++I) {
|
||||
if ((*I)->getSelector() == Sel)
|
||||
return *I;
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
// Get the local class method declared in this interface.
|
||||
ObjCMethodDecl *getClassMethod(Selector &Sel) {
|
||||
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
|
||||
I != E; ++I) {
|
||||
I != E; ++I) {
|
||||
if ((*I)->getSelector() == Sel)
|
||||
return *I;
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
// Lookup a method. First, we search locally. If a method isn't
|
||||
// found, we search referenced protocols and class categories.
|
||||
|
@ -466,20 +466,20 @@ public:
|
|||
// Get the local instance method declared in this interface.
|
||||
ObjCMethodDecl *getInstanceMethod(Selector &Sel) {
|
||||
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end();
|
||||
I != E; ++I) {
|
||||
I != E; ++I) {
|
||||
if ((*I)->getSelector() == Sel)
|
||||
return *I;
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
// Get the local class method declared in this interface.
|
||||
ObjCMethodDecl *getClassMethod(Selector &Sel) {
|
||||
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
|
||||
I != E; ++I) {
|
||||
I != E; ++I) {
|
||||
if ((*I)->getSelector() == Sel)
|
||||
return *I;
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Lookup a method. First, we search locally. If a method isn't
|
||||
|
@ -656,20 +656,20 @@ public:
|
|||
// Get the local instance method declared in this interface.
|
||||
ObjCMethodDecl *getInstanceMethod(Selector &Sel) {
|
||||
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end();
|
||||
I != E; ++I) {
|
||||
I != E; ++I) {
|
||||
if ((*I)->getSelector() == Sel)
|
||||
return *I;
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
// Get the local class method declared in this interface.
|
||||
ObjCMethodDecl *getClassMethod(Selector &Sel) {
|
||||
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
|
||||
I != E; ++I) {
|
||||
I != E; ++I) {
|
||||
if ((*I)->getSelector() == Sel)
|
||||
return *I;
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void addMethods(ObjCMethodDecl **insMethods, unsigned numInsMembers,
|
||||
|
|
|
@ -160,8 +160,8 @@ public:
|
|||
}
|
||||
|
||||
virtual DeclTy *ActOnLinkageSpec(SourceLocation Loc, SourceLocation LBrace,
|
||||
SourceLocation RBrace, const char *Lang,
|
||||
unsigned StrSize, DeclTy *D) {
|
||||
SourceLocation RBrace, const char *Lang,
|
||||
unsigned StrSize, DeclTy *D) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@ private:
|
|||
bool ParseObjCProtocolReferences(llvm::SmallVectorImpl<IdentifierInfo*> &,
|
||||
SourceLocation &endProtoLoc);
|
||||
void ParseObjCInterfaceDeclList(DeclTy *interfaceDecl,
|
||||
tok::ObjCKeywordKind contextKey);
|
||||
tok::ObjCKeywordKind contextKey);
|
||||
DeclTy *ParseObjCAtProtocolDeclaration(SourceLocation atLoc);
|
||||
|
||||
DeclTy *ObjCImpDecl;
|
||||
|
@ -301,7 +301,7 @@ private:
|
|||
TypeTy *ParseObjCTypeName(ObjCDeclSpec &DS);
|
||||
void ParseObjCMethodRequirement();
|
||||
DeclTy *ParseObjCMethodPrototype(DeclTy *classOrCat,
|
||||
tok::ObjCKeywordKind MethodImplKind = tok::objc_not_keyword);
|
||||
tok::ObjCKeywordKind MethodImplKind = tok::objc_not_keyword);
|
||||
DeclTy *ParseObjCMethodDecl(SourceLocation mLoc, tok::TokenKind mType,
|
||||
DeclTy *classDecl,
|
||||
tok::ObjCKeywordKind MethodImplKind = tok::objc_not_keyword);
|
||||
|
|
Загрузка…
Ссылка в новой задаче