From f863ee2949e1dec8f9444cc47983c6030034bb93 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 25 Feb 2014 20:01:08 +0000 Subject: Store a DataLayout in Module. Now that DataLayout is not a pass, store one in Module. Since the C API expects to be able to get a char* to the datalayout description, we have to keep a std::string somewhere. This patch keeps it in Module and also uses it to represent modules without a DataLayout. Once DataLayout is mandatory, we should probably move the string to DataLayout itself since it won't be necessary anymore to represent the special case of a module without a DataLayout. llvm-svn: 202190 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Bitcode/Writer') diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 1d763d66ddc..718cd123898 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -530,9 +530,9 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE, if (!M->getTargetTriple().empty()) WriteStringRecord(bitc::MODULE_CODE_TRIPLE, M->getTargetTriple(), 0/*TODO*/, Stream); - if (!M->getDataLayout().empty()) - WriteStringRecord(bitc::MODULE_CODE_DATALAYOUT, M->getDataLayout(), - 0/*TODO*/, Stream); + const std::string &DL = M->getDataLayoutStr(); + if (!DL.empty()) + WriteStringRecord(bitc::MODULE_CODE_DATALAYOUT, DL, 0 /*TODO*/, Stream); if (!M->getModuleInlineAsm().empty()) WriteStringRecord(bitc::MODULE_CODE_ASM, M->getModuleInlineAsm(), 0/*TODO*/, Stream); -- cgit v1.2.3