aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2010-01-18 20:42:09 +0000
committerVictor Hernandez <vhernandez@apple.com>2010-01-18 20:42:09 +0000
commitde32533265a062e3e9f59f01f5628276d84b059f (patch)
treef9fdf6194d8899ff99e38c7e5b6f2069c49e508b
parentc67e7eca57739e96153f22b367238bf76c44d086 (diff)
downloadexternal_llvm-de32533265a062e3e9f59f01f5628276d84b059f.zip
external_llvm-de32533265a062e3e9f59f01f5628276d84b059f.tar.gz
external_llvm-de32533265a062e3e9f59f01f5628276d84b059f.tar.bz2
Make findDbgDeclare/findDbgGlobalDeclare local static functions; avoid Elts array
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93764 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Analysis/DebugInfo.h7
-rw-r--r--lib/Analysis/DebugInfo.cpp13
2 files changed, 7 insertions, 13 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h
index cc9514c..b74fe70 100644
--- a/include/llvm/Analysis/DebugInfo.h
+++ b/include/llvm/Analysis/DebugInfo.h
@@ -656,13 +656,6 @@ namespace llvm {
Constant *GetTagConstant(unsigned TAG);
};
- /// Finds the dbg.declare intrinsic corresponding to this value if any.
- /// It looks through pointer casts too.
- const DbgDeclareInst *findDbgDeclare(const Value *V);
-
- /// Find the debug info descriptor corresponding to this global variable.
- Value *findDbgGlobalDeclare(GlobalVariable *V);
-
bool getLocationInfo(const Value *V, std::string &DisplayName,
std::string &Type, unsigned &LineNo, std::string &File,
std::string &Dir);
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index d7804ac..a16db35 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -1035,8 +1035,8 @@ Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D,
if (!DeclareFn)
DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);
- Value *Elts[] = { Storage };
- Value *Args[] = { MDNode::get(Storage->getContext(), Elts, 1), D.getNode() };
+ Value *Args[] = { MDNode::get(Storage->getContext(), &Storage, 1),
+ D.getNode() };
return CallInst::Create(DeclareFn, Args, Args+2, "", InsertBefore);
}
@@ -1046,8 +1046,8 @@ Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D,
if (!DeclareFn)
DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);
- Value *Elts[] = { Storage };
- Value *Args[] = { MDNode::get(Storage->getContext(), Elts, 1), D.getNode() };
+ Value *Args[] = { MDNode::get(Storage->getContext(), &Storage, 1),
+ D.getNode() };
return CallInst::Create(DeclareFn, Args, Args+2, "", InsertAtEnd);
}
@@ -1234,7 +1234,8 @@ bool DebugInfoFinder::addSubprogram(DISubprogram SP) {
return true;
}
-Value *llvm::findDbgGlobalDeclare(GlobalVariable *V) {
+/// Find the debug info descriptor corresponding to this global variable.
+static Value *findDbgGlobalDeclare(GlobalVariable *V) {
const Module *M = V->getParent();
NamedMDNode *NMD = M->getNamedMetadata("llvm.dbg.gv");
if (!NMD)
@@ -1252,7 +1253,7 @@ Value *llvm::findDbgGlobalDeclare(GlobalVariable *V) {
/// Finds the llvm.dbg.declare intrinsic corresponding to this value if any.
/// It looks through pointer casts too.
-const DbgDeclareInst *llvm::findDbgDeclare(const Value *V) {
+static const DbgDeclareInst *findDbgDeclare(const Value *V) {
V = V->stripPointerCasts();
if (!isa<Instruction>(V) && !isa<Argument>(V))