Add IWYU mapping for exception_defines.h.

R=csilvers,dnovillo
DELTA=4  (4 added, 0 deleted, 0 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=2868
This commit is contained in:
csilvers+iwyu 2011-08-09 00:22:22 +00:00
parent 1f6396449c
commit 93d9bdde25
3 changed files with 7 additions and 3 deletions

View File

@ -149,7 +149,7 @@ SourceLocation ASTNode::GetLocation() const {
source_manager_.getFileID(full_loc.getSpellingLoc()));
const FileEntry* instantiation_file =
source_manager_.getFileEntryForID(
source_manager_.getFileID(full_loc.getExpansionLoc()));
source_manager_.getFileID(full_loc.getInstantiationLoc()));
if (spelling_file != instantiation_file)
return SourceLocation();
}

View File

@ -632,6 +632,10 @@ const IncludePicker::IncludeMapEntry cpp_include_map[] = {
{ "<ostream>", kPublic, "<istream>", kPublic },
{ "<ostream>", kPublic, "<sstream>", kPublic },
{ "<streambuf>", kPublic, "<ios>", kPublic },
// The location of exception_defines.h varies by GCC version. It should
// never be included directly.
{ "<bits/exception_defines.h>", kPrivate, "<exception>", kPublic },
{ "<exception_defines.h>", kPrivate, "<exception>", kPublic },
};
const IncludePicker::IncludeMapEntry google_include_map[] = {

View File

@ -97,7 +97,7 @@ inline clang::FullSourceLoc GetSpellingLoc(clang::SourceLocation loc) {
inline clang::FullSourceLoc GetInstantiationLoc(clang::SourceLocation loc) {
clang::FullSourceLoc fullloc(loc, *GlobalSourceManager());
return fullloc.isValid() ? fullloc.getExpansionLoc() : fullloc;
return fullloc.isValid() ? fullloc.getInstantiationLoc() : fullloc;
}
inline bool IsInMacro(clang::SourceLocation loc) {
@ -116,7 +116,7 @@ inline int GetLineNumber(clang::SourceLocation loc) {
bool invalid = false;
int retval = fullloc.getSpellingLineNumber(&invalid);
if (invalid)
retval = fullloc.getExpansionLineNumber(&invalid);
retval = fullloc.getInstantiationLineNumber(&invalid);
if (invalid)
retval = -1;
return retval;