aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DebugInfoMetadata.cpp
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2016-02-29 18:59:48 +0000
committerDehao Chen <dehao@google.com>2016-02-29 18:59:48 +0000
commit939993ff2fe38eca498b0806b22a35412222a0eb (patch)
treea5a4778aee089d09bd035f4b520f2b25a3dd2885 /llvm/lib/IR/DebugInfoMetadata.cpp
parent522b5cb3753f39ceb021ab2511c54d7163940b06 (diff)
downloadllvm-939993ff2fe38eca498b0806b22a35412222a0eb.zip
llvm-939993ff2fe38eca498b0806b22a35412222a0eb.tar.gz
llvm-939993ff2fe38eca498b0806b22a35412222a0eb.tar.bz2
Move discriminator assignment to the right place.
Summary: Now discriminator is assigned per-function instead of per-module. Reviewers: davidxl, dnovillo Subscribers: dblaikie, llvm-commits Differential Revision: http://reviews.llvm.org/D17664 llvm-svn: 262240
Diffstat (limited to 'llvm/lib/IR/DebugInfoMetadata.cpp')
-rw-r--r--llvm/lib/IR/DebugInfoMetadata.cpp17
1 files changed, 0 insertions, 17 deletions
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp
index 58e0abd..3dca84d 100644
--- a/llvm/lib/IR/DebugInfoMetadata.cpp
+++ b/llvm/lib/IR/DebugInfoMetadata.cpp
@@ -66,23 +66,6 @@ DILocation *DILocation::getImpl(LLVMContext &Context, unsigned Line,
Storage, Context.pImpl->DILocations);
}
-unsigned DILocation::computeNewDiscriminator() const {
- // FIXME: This seems completely wrong.
- //
- // 1. If two modules are generated in the same context, then the second
- // Module will get different discriminators than it would have if it were
- // generated in its own context.
- // 2. If this function is called after round-tripping to bitcode instead of
- // before, it will give a different (and potentially incorrect!) return.
- //
- // The discriminator should instead be calculated from local information
- // where it's actually needed. This logic should be moved to
- // AddDiscriminators::runOnFunction(), where it doesn't pollute the
- // LLVMContext.
- std::pair<const char *, unsigned> Key(getFilename().data(), getLine());
- return ++getContext().pImpl->DiscriminatorTable[Key];
-}
-
unsigned DINode::getFlag(StringRef Flag) {
return StringSwitch<unsigned>(Flag)
#define HANDLE_DI_FLAG(ID, NAME) .Case("DIFlag" #NAME, Flag##NAME)