summaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Metadata.cpp
diff options
context:
space:
mode:
authorShubham Sandeep Rastogi <srastogi22@apple.com>2022-11-07 15:04:16 -0800
committerShubham Sandeep Rastogi <srastogi22@apple.com>2022-11-07 15:09:05 -0800
commit41f5a0004e442ae71c8e754fdadb4bd1e172fb2d (patch)
treeb0f69f186e5f2f88d986acc1750cac9d463417e6 /llvm/lib/IR/Metadata.cpp
parent4c37a413e582de06b8d3ecd233588fc341ce95e0 (diff)
Revert "[Assignment Tracking][5/*] Add core infrastructure for instruction reference"
This reverts commit 171f7024cc82e8702abebdedb699d37b50574be7. Reverting this patch because it causes a cyclic dependency in the module build https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/48197/consoleFull#-69937453049ba4694-19c4-4d7e-bec5-911270d8a58c In file included from <module-includes>:1: /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/IR/Argument.h:18:10: fatal error: cyclic dependency in module 'LLVM_IR': LLVM_IR -> LLVM_intrinsic_gen -> LLVM_IR ^ While building module 'LLVM_MC' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14: While building module 'LLVM_IR' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCPseudoProbe.h:57: In file included from <module-includes>:12: /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/IR/DebugInfo.h:24:10: fatal error: could not build module 'LLVM_intrinsic_gen' ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ While building module 'LLVM_MC' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14: In file included from <module-includes>:15: In file included from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCContext.h:23: /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCPseudoProbe.h:57:10: fatal error: could not build module 'LLVM_IR' ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14:10: fatal error: could not build module 'LLVM_MC' ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ 4 errors generated.
Diffstat (limited to 'llvm/lib/IR/Metadata.cpp')
-rw-r--r--llvm/lib/IR/Metadata.cpp41
1 files changed, 0 insertions, 41 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 533690203189..052f3b1b37de 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -1425,37 +1425,6 @@ void Instruction::dropUnknownNonDebugMetadata(ArrayRef<unsigned> KnownIDs) {
}
}
-void Instruction::updateDIAssignIDMapping(DIAssignID *ID) {
- auto &IDToInstrs = getContext().pImpl->AssignmentIDToInstrs;
- if (const DIAssignID *CurrentID =
- cast_or_null<DIAssignID>(getMetadata(LLVMContext::MD_DIAssignID))) {
- // Nothing to do if the ID isn't changing.
- if (ID == CurrentID)
- return;
-
- // Unmap this instruction from its current ID.
- auto InstrsIt = IDToInstrs.find(CurrentID);
- assert(InstrsIt != IDToInstrs.end() &&
- "Expect existing attachment to be mapped");
-
- auto &InstVec = InstrsIt->second;
- auto *InstIt = std::find(InstVec.begin(), InstVec.end(), this);
- assert(InstIt != InstVec.end() &&
- "Expect instruction to be mapped to attachment");
- // The vector contains a ptr to this. If this is the only element in the
- // vector, remove the ID:vector entry, otherwise just remove the
- // instruction from the vector.
- if (InstVec.size() == 1)
- IDToInstrs.erase(InstrsIt);
- else
- InstVec.erase(InstIt);
- }
-
- // Map this instruction to the new ID.
- if (ID)
- IDToInstrs[ID].push_back(this);
-}
-
void Instruction::setMetadata(unsigned KindID, MDNode *Node) {
if (!Node && !hasMetadata())
return;
@@ -1466,16 +1435,6 @@ void Instruction::setMetadata(unsigned KindID, MDNode *Node) {
return;
}
- // Update DIAssignID to Instruction(s) mapping.
- if (KindID == LLVMContext::MD_DIAssignID) {
- // The DIAssignID tracking infrastructure doesn't support RAUWing temporary
- // nodes with DIAssignIDs. The cast_or_null below would also catch this, but
- // having a dedicated assert helps make this obvious.
- assert((!Node || !Node->isTemporary()) &&
- "Temporary DIAssignIDs are invalid");
- updateDIAssignIDMapping(cast_or_null<DIAssignID>(Node));
- }
-
Value::setMetadata(KindID, Node);
}