[PATCH] Move getFileNode() from DIFile to DIScope

Eric Christopher echristo at gmail.com
Sun Apr 14 23:20:38 PDT 2013


Eh?

-eric

On Sun, Apr 14, 2013 at 9:47 PM, Peter Collingbourne <peter at pcc.me.uk> wrote:
> Hi dblaikie,
>
> http://llvm-reviews.chandlerc.com/D670
>
> Files:
>   include/llvm/DebugInfo.h
>   lib/IR/DebugInfo.cpp
>
> Index: include/llvm/DebugInfo.h
> ===================================================================
> --- include/llvm/DebugInfo.h
> +++ include/llvm/DebugInfo.h
> @@ -165,6 +165,7 @@
>    public:
>      explicit DIScope(const MDNode *N = 0) : DIDescriptor (N) {}
>
> +    MDNode *getFileNode() const;
>      StringRef getFilename() const;
>      StringRef getDirectory() const;
>    };
> @@ -177,7 +178,6 @@
>        if (DbgNode && !isFile())
>          DbgNode = 0;
>      }
> -    MDNode *getFileNode() const;
>      bool Verify() const;
>    };
>
> Index: lib/IR/DebugInfo.cpp
> ===================================================================
> --- lib/IR/DebugInfo.cpp
> +++ lib/IR/DebugInfo.cpp
> @@ -541,7 +541,7 @@
>  }
>
>  /// \brief Retrieve the MDNode for the directory/file pair.
> -MDNode *DIFile::getFileNode() const {
> +MDNode *DIScope::getFileNode() const {
>    return const_cast<MDNode*>(getNodeField(DbgNode, 1));
>  }
>
> @@ -682,15 +682,11 @@
>  }
>
>  StringRef DIScope::getFilename() const {
> -  if (!DbgNode)
> -    return StringRef();
> -  return ::getStringField(getNodeField(DbgNode, 1), 0);
> +  return ::getStringField(getFileNode(), 0);
>  }
>
>  StringRef DIScope::getDirectory() const {
> -  if (!DbgNode)
> -    return StringRef();
> -  return ::getStringField(getNodeField(DbgNode, 1), 1);
> +  return ::getStringField(getFileNode(), 1);
>  }
>
>  DIArray DICompileUnit::getEnumTypes() const {
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list