llvm::ConstantArray::get(llvm::LLVMContext&, llvm::StringRef, bool) deprecated?

Hi all;

I have been trying to use the llvm::ConstantArray::get(llvm::LLVMContext&, llvm::StringRef, bool) function but seems it has been deprecated.

ProfileDependence.cpp:68:73: error: no matching function for call to ‘llvm::ConstantArray::get(llvm::LLVMContext&, llvm::StringRef, bool)’
ProfileDependence.cpp:68:73: note: candidate is:
/home/arnie/llvm-clang/llvm/include/llvm/Constants.h:354:20: note: static llvm::Constant* llvm::ConstantArray::get(llvm::ArrayType*, llvm::ArrayRefllvm::Constant*)

Could anyone tell me how to give a value (lets say “hello world”) to the Array Constant using currently available get method?

Previously llvm::ConstantArray::get(getGlobalContext(), “hello world”, true) should have worked.

Thank you;

Hi Arnamoy,

I have been trying to use the llvm::ConstantArray::get(llvm::LLVMContext&,
llvm::StringRef, bool) function but seems it has been deprecated.

maybe you are looking for ConstantDataArray::getString?

Ciao, Duncan.

ConstantDataArray::getString.

-Eli