[PATCH] D59887: [Syntax] Introduce TokenBuffer, start clangToolingSyntax library

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 27 09:49:22 PDT 2019


ilya-biryukov marked an inline comment as done.
ilya-biryukov added inline comments.


================
Comment at: clang/include/clang/Tooling/Syntax/TokenBuffer.h:130
+  /// result.
+  llvm::ArrayRef<MacroExpansion> expansions() const { return Expansions; }
+  /// Tokens of macro directives and top-level macro expansions. These are not
----------------
@gribozavr, note that I left the name expansions.
The reasoning is that it seems to describe both the functional and non-functional macros, while "invocation" is only applicable to functional macros.
```
#define FOO int
#define ID(a)

FOO // a macro expansion
ID(a = 10;); // a macro invocation *and* a macro expansion.
```


================
Comment at: clang/unittests/Tooling/Syntax/TokenBufferTest.cpp:157
+    std::string NullTerminated = Text.str();
+    auto FID = SourceMgr->createFileID(llvm::MemoryBuffer::getMemBufferCopy(
+        StringRef(NullTerminated.data(), NullTerminated.size() + 1)));
----------------
Eugene.Zelenko wrote:
> Return type is not obvious, so auto should not be used.
It is `createFileID` definitely returns `FileID`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59887/new/

https://reviews.llvm.org/D59887





More information about the cfe-commits mailing list