diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-20 23:27:33 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-20 23:27:33 +0000 |
commit | 45e8cf573219434ffd1e45d0a1a9b9cbb854d522 (patch) | |
tree | 904ce72c01c7f2792d87c3d7a10885ec238c893c /clang/lib/Lex/PreprocessingRecord.cpp | |
parent | d70da081609ff3cd4a9150b42e095fc42bdec33d (diff) | |
download | bcm5719-llvm-45e8cf573219434ffd1e45d0a1a9b9cbb854d522.tar.gz bcm5719-llvm-45e8cf573219434ffd1e45d0a1a9b9cbb854d522.zip |
[libclang] When pointing at a macro expansion inside a macro argument,
return a cursor for the inner macro.
llvm-svn: 140207
Diffstat (limited to 'clang/lib/Lex/PreprocessingRecord.cpp')
-rw-r--r-- | clang/lib/Lex/PreprocessingRecord.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Lex/PreprocessingRecord.cpp b/clang/lib/Lex/PreprocessingRecord.cpp index 2368b389810..3f288b0fd9f 100644 --- a/clang/lib/Lex/PreprocessingRecord.cpp +++ b/clang/lib/Lex/PreprocessingRecord.cpp @@ -145,10 +145,10 @@ unsigned PreprocessingRecord::findEndLocalPreprocessedEntity( } void PreprocessingRecord::addPreprocessedEntity(PreprocessedEntity *Entity) { - SourceLocation Loc = Entity->getSourceRange().getBegin(); + assert(Entity); assert((PreprocessedEntities.empty() || - !SourceMgr.isBeforeInTranslationUnit(Loc, - PreprocessedEntities.back()->getSourceRange().getEnd())) && + !SourceMgr.isBeforeInTranslationUnit(Entity->getSourceRange().getBegin(), + PreprocessedEntities.back()->getSourceRange().getBegin())) && "Adding a preprocessed entity that is before the previous one in TU"); PreprocessedEntities.push_back(Entity); } |