summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugLoc.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-10-02 21:56:57 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-10-02 21:56:57 +0000
commit571f97bd9055738e88c982564c06ba6d48ac7f9f (patch)
tree8853f1ba2183cc4f7d5c8fb454188b705e445e1a /llvm/lib/IR/DebugLoc.cpp
parent02b418a875b630be83fad340e3a213701904617c (diff)
downloadbcm5719-llvm-571f97bd9055738e88c982564c06ba6d48ac7f9f.tar.gz
bcm5719-llvm-571f97bd9055738e88c982564c06ba6d48ac7f9f.zip
DI: Fold constant arguments into a single MDString
This patch addresses the first stage of PR17891 by folding constant arguments together into a single MDString. Integers are stringified and a `\0` character is used as a separator. Part of PR17891. Note: I've attached my testcases upgrade scripts to the PR. If I've just broken your out-of-tree testcases, they might help. llvm-svn: 218914
Diffstat (limited to 'llvm/lib/IR/DebugLoc.cpp')
-rw-r--r--llvm/lib/IR/DebugLoc.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/IR/DebugLoc.cpp b/llvm/lib/IR/DebugLoc.cpp
index e8bdccebae9..718da852fec 100644
--- a/llvm/lib/IR/DebugLoc.cpp
+++ b/llvm/lib/IR/DebugLoc.cpp
@@ -79,14 +79,8 @@ MDNode *DebugLoc::getScopeNode(const LLVMContext &Ctx) const {
DebugLoc DebugLoc::getFnDebugLoc(const LLVMContext &Ctx) const {
const MDNode *Scope = getScopeNode(Ctx);
DISubprogram SP = getDISubprogram(Scope);
- if (SP.isSubprogram()) {
- // Check for number of operands since the compatibility is
- // cheap here. FIXME: Name the magic constant.
- if (SP->getNumOperands() > 19)
- return DebugLoc::get(SP.getScopeLineNumber(), 0, SP);
- else
- return DebugLoc::get(SP.getLineNumber(), 0, SP);
- }
+ if (SP.isSubprogram())
+ return DebugLoc::get(SP.getScopeLineNumber(), 0, SP);
return DebugLoc();
}
OpenPOWER on IntegriCloud