[PATCH] D63640: [clang] Improve Serialization/Imporing of APValues
Gabor Marton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 4 02:29:15 PDT 2019
martong added inline comments.
================
Comment at: clang/include/clang/AST/ASTImporter.h:331
+ ///
+ /// \return the equivalent APValue in the "from" Constext or the import
+ /// error.
----------------
martong wrote:
> typo: `Constext` -> `Context`
> Also, we return with the APValue in the "to" context, not the one in the "from" context.
The typo is still there: `Constext` has an extra `s`.
================
Comment at: clang/lib/AST/ASTImporter.cpp:8503
+llvm::Expected<APValue> ASTImporter::Import(const APValue &FromValue) {
+ APValue Result;
----------------
Tyker wrote:
> martong wrote:
> > Looks okay, but could we have unit tests for this in ASTImporterTest.cpp?
> I tested importing using the same test file as serialization `clang/test/PCH/APValue.cpp` with `-ast-merge` which uses importing. this prevent duplicating the test code for importing and serializing. is the unit-test in ASTImporterTest.cpp necessary anyway ?
Okay, that's fine I missed that previously, so there is no need for the unit-tests in this case.
Though maybe the `-ast-merge` part of the test should reside in the `clang/test/ASTMerge` directory, because that is where all the other `-ast-merge` tests are.
I am not sure how to solve that nicely, because i see you use the same file for both the serialization and for the import.
Perhaps there should be a common header file which is included both in `test/PCH/APValue.cpp` and in `test/ASTMerge/apvalue/test.cpp`?
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63640/new/
https://reviews.llvm.org/D63640
More information about the cfe-commits
mailing list