[llvm-commits] [llvm] r76759 - in /llvm/trunk: include/llvm/Bitcode/LLVMBitCodes.h include/llvm/Constants.h include/llvm/MDNode.h include/llvm/Value.h lib/AsmParser/LLParser.cpp lib/AsmParser/LLParser.h lib/Bitcode/Reader/BitcodeReader.cpp lib/Bitcode/Reader/BitcodeReader.h lib/Bitcode/Writer/BitcodeWriter.cpp lib/Bitcode/Writer/ValueEnumerator.cpp lib/VMCore/AsmWriter.cpp lib/VMCore/Constants.cpp lib/VMCore/Value.cpp test/Feature/embeddedmetadata.ll test/Feature/mdnode.ll tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp

Chris Lattner clattner at apple.com
Wed Jul 22 17:16:56 PDT 2009


On Jul 22, 2009, at 5:15 PM, Devang Patel wrote:

>>>
>>> +  friend class LLVMContextImpl;
>>> +
>>> +public:
>>> +  MDString(const char *begin, const char *end)
>>> +    : MetadataBase(Type::MetadataTy, Value::MDStringVal),
>>> +      StrBegin(begin), StrEnd(end) {}
>>
>> MDStrings should be uniqued, right?  If so, this ctor should be  
>> private.
>
> There is not getMDString(). The LLVMContext manages MDString cache  
> and uses this constructor.

Right, you want the ctor to be private so that random code can't 'new'  
these: they have to go through the context.

-Chris



More information about the llvm-commits mailing list