]> granicus.if.org Git - clang/commit
-frewrite-includes: Rework how includes and modules are differentiated
authorJustin Bogner <mail@justinbogner.com>
Wed, 1 Jul 2015 04:40:10 +0000 (04:40 +0000)
committerJustin Bogner <mail@justinbogner.com>
Wed, 1 Jul 2015 04:40:10 +0000 (04:40 +0000)
commitb4c0304eb5773e44575b15d74c461fa72bf79b33
treeaac5d37708181366b5904ca5db26a57a84ade80a
parentdc8f320f3b4a3541df82ea1f1f6fe43bb85963a8
-frewrite-includes: Rework how includes and modules are differentiated

The map of FileChange structs here was storing two disjoint types of
information:

1. A pointer to the Module that an #include directive implicitly
   imported

2. A FileID and FileType for an included file. These would be left
   uninitialized in the Module case.

This change splits these two kinds of information into their own maps,
which both simplifies how we access either and avoids the undefined
behaviour we were hitting due to the uninitialized fields in the
included file case.

Mostly NFC, but fixes some errors found by self-host with ubsan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241140 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Frontend/Rewrite/InclusionRewriter.cpp