[PATCH] D31697: Check for null before using TUScope

Kim Gräsman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 29 05:12:52 PDT 2017


kimgr added a comment.

I did some more debugging today. This happens when we attempt to analyze llvm/Support/MathExtras.h, and only for the function templates that use Microsoft intrinsics (e.g. `_BitScanForward` in `TrailingZerosCounter<T>`.) So there's something in the parsing of builtins/intrinsics that requires `TUScope` to be non-null.

Can we seed Sema with a valid `TUScope` before invoking `LateTemplateParser`, and if so, how? Or is this because we invoke the parser multiple times? I'm guessing Clang is already done parsing when we invoke the late template parsing.

Grateful for any ideas here.


https://reviews.llvm.org/D31697





More information about the cfe-commits mailing list