[PATCH] D37624: add support for -fno-instrument-functions and -finstrument-functions-exclude-{file, function}-list=<arg1, arg2, ...> to match gcc options.

Hal Finkel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 29 18:30:30 PDT 2017


hfinkel added a comment.

Please also add a C++ test to check the mangling-related features.



================
Comment at: lib/CodeGen/CodeGenFunction.cpp:419
+// Assume that __cxa_demangle is provided by libcxxabi (except for Windows).
+extern "C" char *__cxa_demangle(const char *mangled_name, char *output_buffer,
+                                size_t *length, int *status);
----------------
Using the system demangler here seems like the wrong solution. You have the current function declaration, `CurFuncDecl`, and from it you should be able to extract the full name.

I think that this will do it:

  std::string FullFuncName = PredefinedExpr::ComputeName(
          PredefinedExpr::PrettyFunctionNoVirtual, CurFuncDecl);



================
Comment at: lib/CodeGen/CodeGenModule.cpp:4601
+CodeGenModule::GetSourceLocToFileNameMap() {
+  return SourceLocToFileNameMap;
+}
----------------
Make this function inline in the class definition.


https://reviews.llvm.org/D37624





More information about the cfe-commits mailing list