r206039 - [PGO] Change MapRegionCounters to be a RecursiveASTVisitor.

Bob Wilson bob.wilson at apple.com
Fri Apr 11 11:04:48 PDT 2014


On Apr 11, 2014, at 11:00 AM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:

> 
> On Apr 11, 2014, at 10:16, Bob Wilson <bob.wilson at apple.com> wrote:
> 
>> +    // Do not traverse the BlockDecl inside a BlockExpr since each BlockDecl
>> +    // is handled as a separate function.
>> +    bool TraverseBlockExpr(BlockExpr *block) { return true; }
>> +
>> +    bool VisitDecl(const Decl *D) {
>> +      switch (D->getKind()) {
>> +      default:
>> +        break;
>> +      case Decl::Function:
>> +      case Decl::CXXMethod:
>> +      case Decl::CXXConstructor:
>> +      case Decl::CXXDestructor:
>> +      case Decl::CXXConversion:
>> +      case Decl::ObjCMethod:
>> +      case Decl::Block:
>> +        CounterMap[D->getBody()] = NextCounter++;
>> +        break;
>> +      }
>> +      return true;
>>    }
> 
> [Sorry this is broken up.]
> 
> This doesn't look like a new problem, but why aren't we looking at
> FunctionTemplateDecls?

Justin is currently looking to see if we’re missing anything like that. I’m not very familiar with how templates work inside clang. I was assuming that we only care about templates that get instantiated and that we would then see them as ordinary Functions or CXXMethods.



More information about the cfe-commits mailing list