Use llvm casts in various places instead of looking at {Expr,Decl,TypeBase}::getKind()

Also add some FIXMEs for some code in debug info emission that
looks incorrect.
This commit is contained in:
Slava Pestov
2017-01-30 00:03:01 -08:00
parent dca292c652
commit b3cabb0745
10 changed files with 48 additions and 42 deletions

View File

@@ -124,7 +124,7 @@ class AnnotatingPrinter : public StreamPrinter {
}
void deinitDefaultMapToUse(const Decl*D) {
if (D->getKind() == DeclKind::Extension) {
if (isa<ExtensionDecl>(D)) {
DefaultMapToUse = nullptr;
}
}
@@ -154,7 +154,7 @@ public:
bool shouldContinuePre(const Decl *D, Optional<BracketOptions> Bracket) {
assert(Bracket.hasValue());
if (!Bracket.getValue().shouldOpenExtension(D) &&
D->getKind() == DeclKind::Extension)
isa<ExtensionDecl>(D))
return false;
return true;
}
@@ -164,7 +164,7 @@ public:
if (!Bracket.getValue().shouldCloseNominal(D) && dyn_cast<NominalTypeDecl>(D))
return false;
if (!Bracket.getValue().shouldCloseExtension(D) &&
D->getKind() == DeclKind::Extension)
isa<ExtensionDecl>(D))
return false;
return true;
}