IR: Allow GenericDebugNode construction from MDString
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 2 Feb 2015 20:01:03 +0000 (20:01 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 2 Feb 2015 20:01:03 +0000 (20:01 +0000)
commit2a11d590148fd70e4a428f12b43869cc5288f230
tree4b78fc3997fc03b8b8ed56abc02600671be5f37a
parent21b88f5f90171486fe4dd8183144af9530483588
IR: Allow GenericDebugNode construction from MDString

Allow `GenericDebugNode` construction directly from `MDString`, rather
than requiring `StringRef`s.  I've refactored the `StringRef`
constructors to use these.  There's no real functionality change here,
except for exposing the lower-level API.

The purpose of this is to simplify construction of string operands when
reading bitcode.  It's unnecessarily indirect to parse an `MDString` ID,
lookup the `MDString` in the bitcode reader list, get the `StringRef`
out of that, and then have `GenericDebugNode::getImpl()` use
`MDString::get()` to acquire the original `MDString`.  Instead, this
allows the bitcode reader to directly pass in the `MDString`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227848 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/DebugInfoMetadata.h
lib/IR/DebugInfoMetadata.cpp