[llvm] f388735 - [MemoryBuiltin] Cleanup stale todo comments [NFC]
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 7 13:57:29 PST 2022
Author: Philip Reames
Date: 2022-01-07T13:57:20-08:00
New Revision: f38873537bf7e7ef239ffe68b5e5c8b84e0f3758
URL: https://github.com/llvm/llvm-project/commit/f38873537bf7e7ef239ffe68b5e5c8b84e0f3758
DIFF: https://github.com/llvm/llvm-project/commit/f38873537bf7e7ef239ffe68b5e5c8b84e0f3758.diff
LOG: [MemoryBuiltin] Cleanup stale todo comments [NFC]
strdup/strndup are already partially implemented, move remaining comment to relevant place. Remaining named routines are copy routines and mostly handled via intrinsics already - they do not allocate new memory.
Added:
Modified:
llvm/lib/Analysis/MemoryBuiltins.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp
index d5c34bb00df1..fe21ab45d85d 100644
--- a/llvm/lib/Analysis/MemoryBuiltins.cpp
+++ b/llvm/lib/Analysis/MemoryBuiltins.cpp
@@ -643,14 +643,6 @@ SizeOffsetType ObjectSizeOffsetVisitor::visitCallBase(CallBase &CB) {
bool Overflow;
Size = Size.umul_ov(NumElems, Overflow);
return Overflow ? unknown() : std::make_pair(Size, Zero);
-
- // TODO: handle more standard functions (+ wchar cousins):
- // - strdup / strndup
- // - strcpy / strncpy
- // - strcat / strncat
- // - memcpy / memmove
- // - strcat / strncat
- // - memset
}
SizeOffsetType
@@ -874,7 +866,7 @@ SizeOffsetEvalType ObjectSizeOffsetEvaluator::visitCallBase(CallBase &CB) {
// Handle strdup-like functions separately.
if (FnData->AllocTy == StrDupLike) {
- // TODO
+ // TODO: implement evaluation of strdup/strndup
return unknown();
}
@@ -887,14 +879,6 @@ SizeOffsetEvalType ObjectSizeOffsetEvaluator::visitCallBase(CallBase &CB) {
SecondArg = Builder.CreateZExtOrTrunc(SecondArg, IntTy);
Value *Size = Builder.CreateMul(FirstArg, SecondArg);
return std::make_pair(Size, Zero);
-
- // TODO: handle more standard functions (+ wchar cousins):
- // - strdup / strndup
- // - strcpy / strncpy
- // - strcat / strncat
- // - memcpy / memmove
- // - strcat / strncat
- // - memset
}
SizeOffsetEvalType
More information about the llvm-commits
mailing list