summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-10-15 16:11:41 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-10-15 16:11:41 +0000
commit3bfffde27a820789b37a0c6e3d7f32d3757f4b32 (patch)
tree6afe88db9b138aa9fb7b045130879ec7fd087de4 /llvm/lib/IR/DebugInfo.cpp
parent146700ee64055aa49b5a5a690ac3bac8075e9aaa (diff)
downloadbcm5719-llvm-3bfffde27a820789b37a0c6e3d7f32d3757f4b32.tar.gz
bcm5719-llvm-3bfffde27a820789b37a0c6e3d7f32d3757f4b32.zip
DI: Use a `DenseMap` instead of named metadata, NFC
Remove a strange round-trip through named metadata to assign preserved local variables to their subprograms. llvm-svn: 219798
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp41
1 files changed, 0 insertions, 41 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 4a52a9312fa..d5c2e6751cc 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -936,47 +936,6 @@ unsigned DILocation::computeNewDiscriminator(LLVMContext &Ctx) {
return ++Ctx.pImpl->DiscriminatorTable[Key];
}
-/// fixupSubprogramName - Replace contains special characters used
-/// in a typical Objective-C names with '.' in a given string.
-static void fixupSubprogramName(DISubprogram Fn, SmallVectorImpl<char> &Out) {
- StringRef FName =
- Fn.getFunction() ? Fn.getFunction()->getName() : Fn.getName();
- FName = Function::getRealLinkageName(FName);
-
- StringRef Prefix("llvm.dbg.lv.");
- Out.reserve(FName.size() + Prefix.size());
- Out.append(Prefix.begin(), Prefix.end());
-
- bool isObjCLike = false;
- for (size_t i = 0, e = FName.size(); i < e; ++i) {
- char C = FName[i];
- if (C == '[')
- isObjCLike = true;
-
- if (isObjCLike && (C == '[' || C == ']' || C == ' ' || C == ':' ||
- C == '+' || C == '(' || C == ')'))
- Out.push_back('.');
- else
- Out.push_back(C);
- }
-}
-
-/// getFnSpecificMDNode - Return a NameMDNode, if available, that is
-/// suitable to hold function specific information.
-NamedMDNode *llvm::getFnSpecificMDNode(const Module &M, DISubprogram Fn) {
- SmallString<32> Name;
- fixupSubprogramName(Fn, Name);
- return M.getNamedMetadata(Name.str());
-}
-
-/// getOrInsertFnSpecificMDNode - Return a NameMDNode that is suitable
-/// to hold function specific information.
-NamedMDNode *llvm::getOrInsertFnSpecificMDNode(Module &M, DISubprogram Fn) {
- SmallString<32> Name;
- fixupSubprogramName(Fn, Name);
- return M.getOrInsertNamedMetadata(Name.str());
-}
-
/// createInlinedVariable - Create a new inlined variable based on current
/// variable.
/// @param DV Current Variable.
OpenPOWER on IntegriCloud