Update ExceptionDemo to use ConstantDataArray.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149867 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Peter Collingbourne 2012-02-06 14:09:13 +00:00
parent 699ddcbcb3
commit 793a32dfb6

View File

@ -878,7 +878,7 @@ void generateStringPrint(llvm::LLVMContext &context,
llvm::Value *stringVar;
llvm::Constant *stringConstant =
llvm::ConstantArray::get(context, toPrint);
llvm::ConstantDataArray::getString(context, toPrint);
if (useGlobal) {
// Note: Does not work without allocation
@ -920,7 +920,8 @@ void generateIntegerPrint(llvm::LLVMContext &context,
llvm::Value &toPrint,
std::string format,
bool useGlobal = true) {
llvm::Constant *stringConstant = llvm::ConstantArray::get(context, format);
llvm::Constant *stringConstant =
llvm::ConstantDataArray::getString(context, format);
llvm::Value *stringVar;
if (useGlobal) {