]> granicus.if.org Git - llvm/commit
The MDString class stored a StringRef to the string which was already in a
authorBill Wendling <isanbard@gmail.com>
Tue, 10 Apr 2012 20:12:16 +0000 (20:12 +0000)
committerBill Wendling <isanbard@gmail.com>
Tue, 10 Apr 2012 20:12:16 +0000 (20:12 +0000)
commit3ecb447f52d169dea6663b95b5b5b43e9bb5826b
tree2e5526e4b3fbb284b6753241cd0f87769c7732b3
parent7f1f1453895431f948abbb5d9bf09b4faf87926a
The MDString class stored a StringRef to the string which was already in a
StringMap. This was redundant and unnecessarily bloated the MDString class.

Because the MDString class is a "Value" and will never have a "name", and
because the Name field in the Value class is a pointer to a StringMap entry, we
repurpose the Name field for an MDString. It stores the StringMap entry in the
Name field, and uses the normal methods to get the string (name) back.

PR12474

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154429 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Metadata.h
include/llvm/Value.h
lib/VMCore/LLVMContextImpl.h
lib/VMCore/Metadata.cpp
lib/VMCore/Value.cpp