[PATCH] D112663: [clang-repl] Allow Interpreter::getSymbolAddress to take a mangled name.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 9 14:50:57 PST 2021


rsmith accepted this revision.
rsmith added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/include/clang/Interpreter/Interpreter.h:72
+
+  ///\returns the \c JITTargetAddress of a \c GlobalDecl. This interface uses
+  /// the CodeGenModule's internal mangling cache to avoid recomputing the
----------------
Add a space before `\returns` please (here and below).


================
Comment at: clang/unittests/Interpreter/IncrementalProcessingTest.cpp:20
 #include "clang/Sema/Sema.h"
+#include "clang/Sema/TemplateDeduction.h"
 #include "llvm/ADT/Triple.h"
----------------
Given that this file is unchanged, do we need the new includes?


================
Comment at: clang/unittests/Interpreter/InterpreterTest.cpp:166
+  auto Addr = cantFail(Interp->getSymbolAddress(MangledName));
+  EXPECT_TRUE(Addr != 0);
+  GlobalDecl GD(FD);
----------------
Use `EXPECT_EQ` and `EXPECT_NE` as appropriate.


================
Comment at: clang/unittests/Interpreter/InterpreterTest.cpp:214
+  auto PTUDeclRange = PTU.TUPart->decls();
+  EXPECT_TRUE(std::distance(PTUDeclRange.begin(), PTUDeclRange.end()));
+
----------------
`EXPECT_TRUE` on an integer seems surprising.


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

https://reviews.llvm.org/D112663



More information about the cfe-commits mailing list