diff options
author | Manuel Klimek <klimek@google.com> | 2014-03-19 10:22:36 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2014-03-19 10:22:36 +0000 |
commit | 98a9a6c6674f0a2aded55a89f6b6d0ef52ab145d (patch) | |
tree | 5cc29e021e140238c73c3bb4601782a61febae6d /clang/lib/Lex/PPDirectives.cpp | |
parent | 8e6829e4369832185333a2ce33f599989309b203 (diff) | |
download | bcm5719-llvm-98a9a6c6674f0a2aded55a89f6b6d0ef52ab145d.tar.gz bcm5719-llvm-98a9a6c6674f0a2aded55a89f6b6d0ef52ab145d.zip |
Use the expansion location of the file name when finding the module.
The spelling location of stringified strings is not a file location.
Optimally, we'll want to solve the problem (as the FIXME states) by
handing in the right FileEntry of the #include location.
llvm-svn: 204220
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 8ef3c918f33..57dc49536af 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -540,7 +540,7 @@ Module *Preprocessor::getModuleForLocation(SourceLocation FilenameLoc) { } // Try to determine the module of the include directive. // FIXME: Look into directly passing the FileEntry from LookupFile instead. - FileID IDOfIncl = SourceMgr.getFileID(SourceMgr.getSpellingLoc(FilenameLoc)); + FileID IDOfIncl = SourceMgr.getFileID(SourceMgr.getExpansionLoc(FilenameLoc)); if (const FileEntry *EntryOfIncl = SourceMgr.getFileEntryForID(IDOfIncl)) { // The include comes from a file. return ModMap.findModuleForHeader(EntryOfIncl).getModule(); |