Skip to content

Commit d6a7da5

Browse files
committed
MemoryBuiltins: only claim an allocator family on builtin functions
This lines up with other parts of the codebase that only use special knowledge about allocator functions if they're builtins. Differential Revision: https://reviews.llvm.org/D123053
1 parent b916414 commit d6a7da5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Analysis/MemoryBuiltins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ Optional<StringRef> llvm::getAllocationFamily(const Value *I,
492492
const TargetLibraryInfo *TLI) {
493493
bool IsNoBuiltin;
494494
const Function *Callee = getCalledFunction(I, IsNoBuiltin);
495-
if (Callee == nullptr)
495+
if (Callee == nullptr || IsNoBuiltin)
496496
return None;
497497
LibFunc TLIFn;
498498
if (!TLI || !TLI->getLibFunc(*Callee, TLIFn) || !TLI->has(TLIFn))

0 commit comments

Comments
 (0)