diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2015-09-11 20:09:11 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2015-09-11 20:09:11 +0000 |
commit | aa98950ec9ff900bdd09ed21cced65670d5b1e75 (patch) | |
tree | afb992287734863993874f35aa303dc8a859b587 /include/clang/Edit/EditedSource.h | |
parent | 218bc14fa53368177f7ea1664f5a377b961308a7 (diff) | |
download | clang-aa98950ec9ff900bdd09ed21cced65670d5b1e75.tar.gz |
[Edit] Fix issue with tracking what macro argument inputs have been edited.
This was not working correctly, leading to erroneously rejecting valid edits.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Edit/EditedSource.h')
-rw-r--r-- | include/clang/Edit/EditedSource.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/clang/Edit/EditedSource.h b/include/clang/Edit/EditedSource.h index 8bc27e73be..b6ec8b8f06 100644 --- a/include/clang/Edit/EditedSource.h +++ b/include/clang/Edit/EditedSource.h @@ -10,9 +10,11 @@ #ifndef LLVM_CLANG_EDIT_EDITEDSOURCE_H #define LLVM_CLANG_EDIT_EDITEDSOURCE_H +#include "clang/Basic/IdentifierTable.h" #include "clang/Edit/FileOffset.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/StringRef.h" +#include "llvm/ADT/TinyPtrVector.h" #include "llvm/Support/Allocator.h" #include <map> @@ -39,14 +41,18 @@ class EditedSource { typedef std::map<FileOffset, FileEdit> FileEditsTy; FileEditsTy FileEdits; - llvm::DenseMap<unsigned, SourceLocation> ExpansionToArgMap; + llvm::DenseMap<unsigned, llvm::TinyPtrVector<IdentifierInfo*>> + ExpansionToArgMap; + SmallVector<std::pair<SourceLocation, IdentifierInfo*>, 2> + CurrCommitMacroArgExps; + IdentifierTable IdentTable; llvm::BumpPtrAllocator StrAlloc; public: EditedSource(const SourceManager &SM, const LangOptions &LangOpts, const PPConditionalDirectiveRecord *PPRec = nullptr) - : SourceMgr(SM), LangOpts(LangOpts), PPRec(PPRec), + : SourceMgr(SM), LangOpts(LangOpts), PPRec(PPRec), IdentTable(LangOpts), StrAlloc() { } const SourceManager &getSourceManager() const { return SourceMgr; } @@ -76,6 +82,12 @@ private: StringRef getSourceText(FileOffset BeginOffs, FileOffset EndOffs, bool &Invalid); FileEditsTy::iterator getActionForOffset(FileOffset Offs); + void deconstructMacroArgLoc(SourceLocation Loc, + SourceLocation &ExpansionLoc, + IdentifierInfo *&II); + + void startingCommit(); + void finishedCommit(); }; } |