Reduce duplication in MCSymbol Name handling. NFC>
authorPete Cooper <peter_cooper@apple.com>
Tue, 9 Jun 2015 20:41:08 +0000 (20:41 +0000)
committerPete Cooper <peter_cooper@apple.com>
Tue, 9 Jun 2015 20:41:08 +0000 (20:41 +0000)
commit38f72d04ea111ae5b8ef79498ad5a97d4a3dc910
tree2bcd91a28a9be85ef54fd5f99618feaecbc45dbd
parent5c8a22f11bd4784cd6b9c375289dadcdc521d49e
Reduce duplication in MCSymbol Name handling.  NFC>

Based on feedback to r239428 by David Blaikie, use const_cast to reduce
duplication of the const and non-const versions of getNameEntryPtr.

Also have that method return the pointer to the name directly instead
of users having to then get the name from the union.

Finally, add a FIXME that we should use a static_assert once available in
the new operator.

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