jlegare updated this revision to Diff 446210.
jlegare added a comment.

Addressing review comments.

- Dropped argument to ShouldInstrumentFunction().
- Added file name based exclusion, which had accidentally been left out of 
previous commit.
- Added demangler.
- Applied git clang-format.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130161

Files:
  clang/lib/CodeGen/CodeGenFunction.cpp


Index: clang/lib/CodeGen/CodeGenFunction.cpp
===================================================================
--- clang/lib/CodeGen/CodeGenFunction.cpp
+++ clang/lib/CodeGen/CodeGenFunction.cpp
@@ -536,8 +536,7 @@
   // generate tracing for it: at link-time, the function will be gone and the
   // first argument to the __cyg_profile_* function will be unresolvable.
   const FunctionDecl *FDecl = dyn_cast<FunctionDecl>(CurFuncDecl);
-  if (FDecl &&
-      FDecl->isInlined() &&
+  if (FDecl && FDecl->isInlined() &&
       !FDecl->isInlineDefinitionExternallyVisible())
     return false;
 
@@ -563,10 +562,11 @@
     typedef std::vector<std::string>::const_iterator ExcludedPathIterator;
 
     const std::vector<std::string> &ExcludedPaths =
-      CGM.getCodeGenOpts().InstrumentFunctionsExcludedPaths;
+        CGM.getCodeGenOpts().InstrumentFunctionsExcludedPaths;
 
     for (ExcludedPathIterator ExcludedPath = ExcludedPaths.begin(),
-           Sentinel = ExcludedPaths.end(); ExcludedPath != Sentinel; 
++ExcludedPath)
+                              Sentinel = ExcludedPaths.end();
+         ExcludedPath != Sentinel; ++ExcludedPath)
       if (Path.find(*ExcludedPath) != std::string::npos)
         return false;
   }
@@ -577,12 +577,12 @@
   // is searched to see if any of them is a substring of our (current) function
   // name.
   const std::vector<std::string> &ExcludedFunctions =
-    CGM.getCodeGenOpts().InstrumentFunctionsExcludedFunctions;
+      CGM.getCodeGenOpts().InstrumentFunctionsExcludedFunctions;
 
   std::string MangledName(CurFn->getName());
   std::string DemangledName(llvm::demangle(MangledName));
   for (ExcludedFunctionIterator ExcludedFunction = ExcludedFunctions.begin(),
-         Sentinel = ExcludedFunctions.end();
+                                Sentinel = ExcludedFunctions.end();
        ExcludedFunction != Sentinel; ++ExcludedFunction)
     if (DemangledName.find(*ExcludedFunction) != std::string::npos)
       return false;


Index: clang/lib/CodeGen/CodeGenFunction.cpp
===================================================================
--- clang/lib/CodeGen/CodeGenFunction.cpp
+++ clang/lib/CodeGen/CodeGenFunction.cpp
@@ -536,8 +536,7 @@
   // generate tracing for it: at link-time, the function will be gone and the
   // first argument to the __cyg_profile_* function will be unresolvable.
   const FunctionDecl *FDecl = dyn_cast<FunctionDecl>(CurFuncDecl);
-  if (FDecl &&
-      FDecl->isInlined() &&
+  if (FDecl && FDecl->isInlined() &&
       !FDecl->isInlineDefinitionExternallyVisible())
     return false;
 
@@ -563,10 +562,11 @@
     typedef std::vector<std::string>::const_iterator ExcludedPathIterator;
 
     const std::vector<std::string> &ExcludedPaths =
-      CGM.getCodeGenOpts().InstrumentFunctionsExcludedPaths;
+        CGM.getCodeGenOpts().InstrumentFunctionsExcludedPaths;
 
     for (ExcludedPathIterator ExcludedPath = ExcludedPaths.begin(),
-           Sentinel = ExcludedPaths.end(); ExcludedPath != Sentinel; ++ExcludedPath)
+                              Sentinel = ExcludedPaths.end();
+         ExcludedPath != Sentinel; ++ExcludedPath)
       if (Path.find(*ExcludedPath) != std::string::npos)
         return false;
   }
@@ -577,12 +577,12 @@
   // is searched to see if any of them is a substring of our (current) function
   // name.
   const std::vector<std::string> &ExcludedFunctions =
-    CGM.getCodeGenOpts().InstrumentFunctionsExcludedFunctions;
+      CGM.getCodeGenOpts().InstrumentFunctionsExcludedFunctions;
 
   std::string MangledName(CurFn->getName());
   std::string DemangledName(llvm::demangle(MangledName));
   for (ExcludedFunctionIterator ExcludedFunction = ExcludedFunctions.begin(),
-         Sentinel = ExcludedFunctions.end();
+                                Sentinel = ExcludedFunctions.end();
        ExcludedFunction != Sentinel; ++ExcludedFunction)
     if (DemangledName.find(*ExcludedFunction) != std::string::npos)
       return false;
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to