On Wed, May 8, 2013 at 1:07 PM, Eric Christopher <[email protected]> wrote:
>> +llvm::DIDescriptor CGDebugInfo::getDeclarationOrDefinition(const Decl *D) {
>> +  if (const TypeDecl *RD = dyn_cast<TypeDecl>(D))
>> +    return CreatePointeeType(QualType(RD->getTypeForDecl(), 0), 
>> llvm::DIFile());
>
> CreatePointeeType?

Hopefully I've explained that in comments:

  // We only need a declaration (not a definition) of the type - so use whatever
  // we would otherwise do to get a type for a pointee. (forward declarations in
  // limited debug info, full definitions (if the type definition is available)
  // in unlimited debug info)

>
>> +  llvm::DenseMap<const Decl *, llvm::WeakVH>::iterator I =
>> +      DeclCache.find(D->getCanonicalDecl());
>> +  if (I == DeclCache.end())
>> +    return llvm::DIDescriptor();
>> +  llvm::Value *V = I->second;
>> +  return llvm::DIDescriptor(dyn_cast_or_null<llvm::MDNode>(V));
>
> This block could use a comment, actually if you could comment the decl
> cache stuff in general that would be better.

Not sure how much/wehre more generally you wanted to comment this, but
I've added some comments in r181672.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to