aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/TargetLoweringObjectFile.cpp
diff options
context:
space:
mode:
authorpzzp <pzzp11@outlook.com>2025-03-22 02:44:01 +0800
committerGitHub <noreply@github.com>2025-03-21 11:44:01 -0700
commitd6a2cca77e3c88755e0f6b0acefffdcfa5eb2fec (patch)
treee1912aa645574a63dedc5548b0d731f66d51e944 /llvm/lib/Target/TargetLoweringObjectFile.cpp
parent9f919661dd2ffe0f9666564e186da68fae401a9e (diff)
downloadllvm-d6a2cca77e3c88755e0f6b0acefffdcfa5eb2fec.zip
llvm-d6a2cca77e3c88755e0f6b0acefffdcfa5eb2fec.tar.gz
llvm-d6a2cca77e3c88755e0f6b0acefffdcfa5eb2fec.tar.bz2
[llvm:ir] Add support for constant data exceeding 4GiB (#126481)
The test file is over 4GiB, which is too big, so I didn’t submit it.
Diffstat (limited to 'llvm/lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r--llvm/lib/Target/TargetLoweringObjectFile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp
index 2f2f194..cab9bc8 100644
--- a/llvm/lib/Target/TargetLoweringObjectFile.cpp
+++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp
@@ -104,14 +104,14 @@ static bool isSuitableForBSS(const GlobalVariable *GV) {
static bool IsNullTerminatedString(const Constant *C) {
// First check: is we have constant array terminated with zero
if (const ConstantDataSequential *CDS = dyn_cast<ConstantDataSequential>(C)) {
- unsigned NumElts = CDS->getNumElements();
+ uint64_t NumElts = CDS->getNumElements();
assert(NumElts != 0 && "Can't have an empty CDS");
if (CDS->getElementAsInteger(NumElts-1) != 0)
return false; // Not null terminated.
// Verify that the null doesn't occur anywhere else in the string.
- for (unsigned i = 0; i != NumElts-1; ++i)
+ for (uint64_t i = 0; i != NumElts - 1; ++i)
if (CDS->getElementAsInteger(i) == 0)
return false;
return true;