public:
std::string MigrateDir;
unsigned ASTMigrateActions;
- unsigned FileId;
+ FileID FileId;
const TypedefDecl *NSIntegerTypedefed;
const TypedefDecl *NSUIntegerTypedefed;
OwningPtr<NSAPI> NSAPIObj;
bool isOutputFile = false)
: MigrateDir(migrateDir),
ASTMigrateActions(astMigrateActions),
- FileId(0), NSIntegerTypedefed(0), NSUIntegerTypedefed(0),
+ NSIntegerTypedefed(0), NSUIntegerTypedefed(0),
Remapper(remapper), FileMgr(fileMgr), PPRec(PPRec), PP(PP),
IsOutputFile(isOutputFile) { }
}
else
return false;
- unsigned FileIdOfTypedefDcl =
- PP.getSourceManager().getFileID(TypedefDcl->getLocation()).getHashValue();
- unsigned FileIdOfEnumDcl =
- PP.getSourceManager().getFileID(EnumDcl->getLocation()).getHashValue();
+ FileID FileIdOfTypedefDcl =
+ PP.getSourceManager().getFileID(TypedefDcl->getLocation());
+ FileID FileIdOfEnumDcl =
+ PP.getSourceManager().getFileID(EnumDcl->getLocation());
if (FileIdOfTypedefDcl != FileIdOfEnumDcl)
return false;
}
return;
if (!Ctx.Idents.get("CF_IMPLICIT_BRIDGING_ENABLED").hasMacroDefinition()) {
CFFunctionIBCandidates.clear();
- FileId = 0;
+ FileId = FileID();
return;
}
// Insert CF_IMPLICIT_BRIDGING_ENABLE/CF_IMPLICIT_BRIDGING_DISABLED
}
commit.insertAfterToken(EndLoc, PragmaString);
Editor->commit(commit);
- FileId = 0;
+ FileId = FileID();
CFFunctionIBCandidates.clear();
}
CF_BRIDGING_KIND AuditKind = migrateAddFunctionAnnotation(Ctx, FuncDecl);
if (AuditKind == CF_BRIDGING_ENABLE) {
CFFunctionIBCandidates.push_back(Decl);
- if (!FileId)
- FileId = PP.getSourceManager().getFileID(Decl->getLocation()).getHashValue();
+ if (FileId.isInvalid())
+ FileId = PP.getSourceManager().getFileID(Decl->getLocation());
}
else if (AuditKind == CF_BRIDGING_MAY_INCLUDE) {
if (!CFFunctionIBCandidates.empty()) {
CFFunctionIBCandidates.push_back(Decl);
- if (!FileId)
- FileId = PP.getSourceManager().getFileID(Decl->getLocation()).getHashValue();
+ if (FileId.isInvalid())
+ FileId = PP.getSourceManager().getFileID(Decl->getLocation());
}
}
else
if (ASTMigrateActions & FrontendOptions::ObjCMT_MigrateDecls) {
for (DeclContext::decl_iterator D = TU->decls_begin(), DEnd = TU->decls_end();
D != DEnd; ++D) {
- if (unsigned FID =
- PP.getSourceManager().getFileID((*D)->getLocation()).getHashValue())
- if (FileId && FileId != FID) {
+ FileID FID = PP.getSourceManager().getFileID((*D)->getLocation());
+ if (!FID.isInvalid())
+ if (!FileId.isInvalid() && FileId != FID) {
if (ASTMigrateActions & FrontendOptions::ObjCMT_Annotation)
AnnotateImplicitBridging(Ctx);
}