diff options
author | Chris Lattner <sabre@nondot.org> | 2012-01-31 06:13:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2012-01-31 06:13:55 +0000 |
commit | ff8f9ec8336c62b5e3504e2a394f4b25c0cb1963 (patch) | |
tree | c6c339de102a4da0ced97f924199633114d10844 /lib/CodeGen/CGRTTI.cpp | |
parent | fdba18263ffd624846701ad115d35edb3e2ee0a7 (diff) |
ConstantArray::get() (for strings) is going away, use
ConstantDataArray::getString instead.
Many instances of ConstantArray::get() could be moved to
use more efficient ConstantDataArray methods that avoid a ton
of intermediate Constant*'s for each element (e.g.
GetConstantArrayFromStringLiteral). I don't plan on doing this
in the short-term though.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149363 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGRTTI.cpp')
-rw-r--r-- | lib/CodeGen/CGRTTI.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp index 120e711e84..a5883f61d6 100644 --- a/lib/CodeGen/CGRTTI.cpp +++ b/lib/CodeGen/CGRTTI.cpp @@ -125,7 +125,8 @@ RTTIBuilder::GetAddrOfTypeName(QualType Ty, // We know that the mangled name of the type starts at index 4 of the // mangled name of the typename, so we can just index into it in order to // get the mangled name of the type. - llvm::Constant *Init = llvm::ConstantArray::get(VMContext, Name.substr(4)); + llvm::Constant *Init = llvm::ConstantDataArray::getString(VMContext, + Name.substr(4)); llvm::GlobalVariable *GV = CGM.CreateOrReplaceCXXRuntimeVariable(Name, Init->getType(), Linkage); |