summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
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
parentfca07890a9918e9814a7c3d6a39ea3a91789b546 (diff)
downloadbcm5719-llvm-6a0746a92f0764f7af1968c84b141ccbe752919c.tar.gz
bcm5719-llvm-6a0746a92f0764f7af1968c84b141ccbe752919c.zip
Change some StringRef::data() reinterpret_cast to bytes_begin() or arrayRefFromStringRef()
llvm-svn: 357852
Diffstat (limited to 'llvm/lib/IR')
-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 a1619921f8b..00c722651ed 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()));
}
OpenPOWER on IntegriCloud