aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Constants.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-04-07 03:58:42 +0000
committerFangrui Song <maskray@google.com>2019-04-07 03:58:42 +0000
commit6a0746a92f0764f7af1968c84b141ccbe752919c (patch)
tree0ee2b9c51b91d60ec561bc3a6ba11e7a8937c29c /llvm/lib/IR/Constants.cpp
parentfca07890a9918e9814a7c3d6a39ea3a91789b546 (diff)
downloadllvm-6a0746a92f0764f7af1968c84b141ccbe752919c.zip
llvm-6a0746a92f0764f7af1968c84b141ccbe752919c.tar.gz
llvm-6a0746a92f0764f7af1968c84b141ccbe752919c.tar.bz2
Change some StringRef::data() reinterpret_cast to bytes_begin() or arrayRefFromStringRef()
llvm-svn: 357852
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r--llvm/lib/IR/Constants.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index a161992..00c7226 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -2576,7 +2576,7 @@ Constant *ConstantDataArray::getFP(LLVMContext &Context,
Constant *ConstantDataArray::getString(LLVMContext &Context,
StringRef Str, bool AddNull) {
if (!AddNull) {
- const uint8_t *Data = reinterpret_cast<const uint8_t *>(Str.data());
+ const uint8_t *Data = Str.bytes_begin();
return get(Context, makeArrayRef(Data, Str.size()));
}