From 2b6b257f4e5503a7a2675bdb8735693db769f75c Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 23 Jul 2016 20:44:14 +0000 Subject: Vendor import of clang release_39 branch r276489: https://llvm.org/svn/llvm-project/cfe/branches/release_39@276489 --- lib/Frontend/Rewrite/InclusionRewriter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/Frontend/Rewrite/InclusionRewriter.cpp') diff --git a/lib/Frontend/Rewrite/InclusionRewriter.cpp b/lib/Frontend/Rewrite/InclusionRewriter.cpp index ca8226251fd9..b761c34fcbde 100644 --- a/lib/Frontend/Rewrite/InclusionRewriter.cpp +++ b/lib/Frontend/Rewrite/InclusionRewriter.cpp @@ -450,7 +450,9 @@ bool InclusionRewriter::Process(FileID FileId, WriteLineInfo(FileName, Line - 1, FileType, ""); StringRef LineInfoExtra; SourceLocation Loc = HashToken.getLocation(); - if (const Module *Mod = FindModuleAtLocation(Loc)) + if (const Module *Mod = PP.getLangOpts().ObjC2 + ? FindModuleAtLocation(Loc) + : nullptr) WriteImplicitModuleImport(Mod); else if (const IncludedFile *Inc = FindIncludeAtLocation(Loc)) { // include and recursively process the file -- cgit v1.2.3