зеркало из https://github.com/microsoft/clang-1.git
ec0550fa36
This allowed me to fix the following hack from this weekend... // FIXME: Devise a way to do this without using strcmp. // Would like to say..."return getAsStructureType() == IdStructType;", but // we don't have a pointer to ASTContext. bool Type::isObjcIdType() const { if (const RecordType *RT = getAsStructureType()) return !strcmp(RT->getDecl()->getName(), "objc_object"); return false; } ...which is now... bool isObjcIdType(QualType T) const { return T->getAsStructureType() == IdStructType; } Side notes: - I had to remove a convenience function from the TypesCompatibleExpr class. int typesAreCompatible() const {return Type::typesAreCompatible(Type1,Type2);} Which required a couple clients get a little more verbose... - Result = TCE->typesAreCompatible(); + Result = Ctx.typesAreCompatible(TCE->getArgType1(), TCE->getArgType2()); Overall, I think this change also makes sense for a couple reasons... 1) Since ASTContext vends types, it makes sense for the type compatibility API to be there. 2) This allows the type compatibility predeciates to refer to data not strictly present in the AST (which I have found problematic on several occasions). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43009 91177308-0d34-0410-b5e6-96231b3b80d8 |
||
---|---|---|
.. | ||
CGBuiltin.cpp | ||
CGDecl.cpp | ||
CGExpr.cpp | ||
CGExprAgg.cpp | ||
CGExprComplex.cpp | ||
CGExprScalar.cpp | ||
CGObjC.cpp | ||
CGStmt.cpp | ||
CodeGenFunction.cpp | ||
CodeGenFunction.h | ||
CodeGenModule.cpp | ||
CodeGenModule.h | ||
CodeGenTypes.cpp | ||
CodeGenTypes.h | ||
Makefile | ||
ModuleBuilder.cpp |