trixirt created this revision. trixirt added reviewers: rsmith, stephenkelly. Herald added a subscriber: cfe-commits.
Include-what-you-use crashes when run against llvm because of late use of TUScope. The testcase is https://github.com/trixirt/include-what-you-use/commit/dfec8cf07015fb5fe2db10df2f0a005250953131 Enabling incremental processing, fixes this problem but causes 3 regression in iwyu. https://github.com/include-what-you-use/include-what-you-use/pull/586 So the fix is moving to clang. Repository: rC Clang https://reviews.llvm.org/D54047 Files: lib/Sema/SemaExpr.cpp Index: lib/Sema/SemaExpr.cpp =================================================================== --- lib/Sema/SemaExpr.cpp +++ lib/Sema/SemaExpr.cpp @@ -905,6 +905,10 @@ UnqualifiedId Name; Name.setIdentifier(PP.getIdentifierInfo("__builtin_trap"), E->getBeginLoc()); + + if (TUScope == nullptr) + return ExprError(); + ExprResult TrapFn = ActOnIdExpression(TUScope, SS, TemplateKWLoc, Name, true, false); if (TrapFn.isInvalid())
Index: lib/Sema/SemaExpr.cpp =================================================================== --- lib/Sema/SemaExpr.cpp +++ lib/Sema/SemaExpr.cpp @@ -905,6 +905,10 @@ UnqualifiedId Name; Name.setIdentifier(PP.getIdentifierInfo("__builtin_trap"), E->getBeginLoc()); + + if (TUScope == nullptr) + return ExprError(); + ExprResult TrapFn = ActOnIdExpression(TUScope, SS, TemplateKWLoc, Name, true, false); if (TrapFn.isInvalid())
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits