aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorYuanfang Chen <yuanfang.chen@sony.com>2020-11-13 09:27:10 -0800
committerYuanfang Chen <yuanfang.chen@sony.com>2020-11-13 09:28:21 -0800
commita223354161104c25f9c6663b66222bd5e1d532cd (patch)
treec3cf23574c83b9aaff898f0fce0e123c5003f467 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parentb184a2eccf3b80eb3ab741e983d4637111942815 (diff)
downloadllvm-a223354161104c25f9c6663b66222bd5e1d532cd.zip
llvm-a223354161104c25f9c6663b66222bd5e1d532cd.tar.gz
llvm-a223354161104c25f9c6663b66222bd5e1d532cd.tar.bz2
[CGProfile] allows bitcast in metadata node storing function pointers
For example, during RAUW in IRMover, the `Function` ValueAsMetadata in "CG Profile" could become bitcast. Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D88433
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index f69b96a..6f9268f 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -345,7 +345,7 @@ void TargetLoweringObjectFileELF::emitModuleMetadata(MCStreamer &Streamer,
if (!MDO)
return nullptr;
auto V = cast<ValueAsMetadata>(MDO);
- const Function *F = cast<Function>(V->getValue());
+ const Function *F = cast<Function>(V->getValue()->stripPointerCasts());
return TM->getSymbol(F);
};