r247447 - Remove a redundant check from CGDebugInfo::shouldOmitDefinition() (NFC).

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 11 13:00:35 PDT 2015


On Fri, Sep 11, 2015 at 11:54 AM, Adrian Prantl via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: adrian
> Date: Fri Sep 11 13:54:28 2015
> New Revision: 247447
>
> URL: http://llvm.org/viewvc/llvm-project?rev=247447&view=rev
> Log:
> Remove a redundant check from CGDebugInfo::shouldOmitDefinition() (NFC).
>
> Modified:
>     cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=247447&r1=247446&r2=247447&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Sep 11 13:54:28 2015
> @@ -1480,14 +1480,8 @@ static bool shouldOmitDefinition(CodeGen
>                                   const RecordDecl *RD,
>                                   const LangOptions &LangOpts) {
>    // Does the type exist in an imported clang module?
> -  if (DebugTypeExtRefs && RD->isFromASTFile()) {
> -    if (auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(RD))
> -      if (CTSD->isExplicitInstantiationOrSpecialization())
> -        // We may not assume that this type made it into the module.
> -        return true;
> -    if (RD->getDefinition())
> +  if (DebugTypeExtRefs && RD->isFromASTFile() && RD->getDefinition())
>

Oh - and do we need to check for "getDefinition" here? Since this function
is itself (by name/use) already about whether definitions should be
omitted? I'm not sure, maybe it still makes sense...


>        return true;
> -  }
>
>    if (DebugKind > CodeGenOptions::LimitedDebugInfo)
>      return false;
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150911/bcffe6e1/attachment.html>


More information about the cfe-commits mailing list