Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion llvm/lib/Analysis/CtxProfAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,9 @@ GlobalValue::GUID AssignGUIDPass::getGUID(const Function &F) {
return F.getGUID();
}
auto *MD = F.getMetadata(GUIDMetadataName);
assert(MD && "guid not found for defined function");
if (!MD)
reportFatalUsageError(
"this pass requires the GUID metadata to be available.");
Comment thread
pektezol marked this conversation as resolved.
Outdated
return cast<ConstantInt>(cast<ConstantAsMetadata>(MD->getOperand(0))
->getValue()
->stripPointerCasts())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; RUN: not opt -passes='ctx-prof-flatten-prethinlink' %s -disable-output 2>&1 | FileCheck %s

; CHECK: LLVM ERROR: this pass requires the GUID metadata to be available.

define void @test() {
ret void
}