diff options
Diffstat (limited to 'llvm/lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r-- | llvm/lib/Target/CppBackend/CPPBackend.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/CppBackend/CPPBackend.cpp b/llvm/lib/Target/CppBackend/CPPBackend.cpp index 5ea6551ebc9..dd5590307ee 100644 --- a/llvm/lib/Target/CppBackend/CPPBackend.cpp +++ b/llvm/lib/Target/CppBackend/CPPBackend.cpp @@ -437,7 +437,7 @@ std::string CppWriter::getCppName(const Value* val) { if (const GlobalVariable* GV = dyn_cast<GlobalVariable>(val)) { name = std::string("gvar_") + - getTypePrefix(GV->getType()->getElementType()); + getTypePrefix(GV->getValueType()); } else if (isa<Function>(val)) { name = std::string("func_"); } else if (const Constant* C = dyn_cast<Constant>(val)) { @@ -997,13 +997,13 @@ void CppWriter::printVariableHead(const GlobalVariable *GV) { if (is_inline) { Out << " = mod->getGlobalVariable(mod->getContext(), "; printEscapedString(GV->getName()); - Out << ", " << getCppName(GV->getType()->getElementType()) << ",true)"; + Out << ", " << getCppName(GV->getValueType()) << ",true)"; nl(Out) << "if (!" << getCppName(GV) << ") {"; in(); nl(Out) << getCppName(GV); } Out << " = new GlobalVariable(/*Module=*/*mod, "; nl(Out) << "/*Type=*/"; - printCppName(GV->getType()->getElementType()); + printCppName(GV->getValueType()); Out << ","; nl(Out) << "/*isConstant=*/" << (GV->isConstant()?"true":"false"); Out << ","; |