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)
commit9146fc8fd67cabc68a612908d909db7339f1e6c7
tree55ef68331f0e5e1af74029c2d34ea513aee30291
parent61e62a5b04ef78e4122b5ec54c21fbd3d978d1e6
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`.

llvm-svn: 227848
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/lib/IR/DebugInfoMetadata.cpp