@@ -1262,15 +1262,6 @@ void ParameterList::dump() const {
1262
1262
}
1263
1263
1264
1264
void ParameterList::dump (raw_ostream &OS, unsigned Indent) const {
1265
- llvm::Optional<llvm::SaveAndRestore<bool >> X;
1266
-
1267
- // Make sure to print type variables if we can get to ASTContext.
1268
- if (size () != 0 && get (0 )) {
1269
- auto &ctx = get (0 )->getASTContext ();
1270
- X.emplace (llvm::SaveAndRestore<bool >(ctx.LangOpts .DebugConstraintSolver ,
1271
- true ));
1272
- }
1273
-
1274
1265
PrintDecl (OS, Indent).printParameterList (this );
1275
1266
llvm::errs () << ' \n ' ;
1276
1267
}
@@ -1293,9 +1284,6 @@ void Decl::dump(const char *filename) const {
1293
1284
}
1294
1285
1295
1286
void Decl::dump (raw_ostream &OS, unsigned Indent) const {
1296
- // Make sure to print type variables.
1297
- llvm::SaveAndRestore<bool > X (getASTContext ().LangOpts .DebugConstraintSolver ,
1298
- true );
1299
1287
PrintDecl (OS, Indent).visit (const_cast <Decl *>(this ));
1300
1288
OS << ' \n ' ;
1301
1289
}
@@ -1407,8 +1395,6 @@ void SourceFile::dump() const {
1407
1395
}
1408
1396
1409
1397
void SourceFile::dump (llvm::raw_ostream &OS) const {
1410
- llvm::SaveAndRestore<bool > X (getASTContext ().LangOpts .DebugConstraintSolver ,
1411
- true );
1412
1398
PrintDecl (OS).visitSourceFile (*this );
1413
1399
llvm::errs () << ' \n ' ;
1414
1400
}
@@ -1826,13 +1812,17 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
1826
1812
}
1827
1813
1828
1814
raw_ostream &printCommon (Expr *E, const char *C) {
1815
+ PrintOptions PO;
1816
+ PO.PrintTypesForDebugging = true ;
1817
+
1829
1818
OS.indent (Indent);
1830
1819
PrintWithColorRAII (OS, ParenthesisColor) << ' (' ;
1831
1820
PrintWithColorRAII (OS, ExprColor) << C;
1832
1821
1833
1822
if (E->isImplicit ())
1834
1823
PrintWithColorRAII (OS, ExprModifierColor) << " implicit" ;
1835
- PrintWithColorRAII (OS, TypeColor) << " type='" << GetTypeOfExpr (E) << ' \' ' ;
1824
+ PrintWithColorRAII (OS, TypeColor) << " type='" ;
1825
+ PrintWithColorRAII (OS, TypeColor) << GetTypeOfExpr (E).getString (PO) << ' \' ' ;
1836
1826
1837
1827
// If we have a source range and an ASTContext, print the source range.
1838
1828
if (auto Ty = GetTypeOfExpr (E)) {
@@ -3749,14 +3739,10 @@ namespace {
3749
3739
} // end anonymous namespace
3750
3740
3751
3741
void Type::dump () const {
3752
- // Make sure to print type variables.
3753
3742
dump (llvm::errs ());
3754
3743
}
3755
3744
3756
3745
void Type::dump (raw_ostream &os, unsigned indent) const {
3757
- // Make sure to print type variables.
3758
- llvm::SaveAndRestore<bool > X (getPointer ()->getASTContext ().LangOpts .
3759
- DebugConstraintSolver, true );
3760
3746
PrintType (os, indent).visit (*this , " " );
3761
3747
os << " \n " ;
3762
3748
}
@@ -3767,10 +3753,6 @@ void TypeBase::dump() const {
3767
3753
}
3768
3754
3769
3755
void TypeBase::dump (raw_ostream &os, unsigned indent) const {
3770
- auto &ctx = const_cast <TypeBase*>(this )->getASTContext ();
3771
-
3772
- // Make sure to print type variables.
3773
- llvm::SaveAndRestore<bool > X (ctx.LangOpts .DebugConstraintSolver , true );
3774
3756
Type (const_cast <TypeBase *>(this )).dump (os, indent);
3775
3757
}
3776
3758
0 commit comments