diff options
| author | Devang Patel <dpatel@apple.com> | 2010-05-20 20:35:24 +0000 | 
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2010-05-20 20:35:24 +0000 | 
| commit | 0adee9b362ac69c6fa6e809d5e99d78d5dc3c587 (patch) | |
| tree | ee6471db50a181177c36a3775f2913f99a3614d9 | |
| parent | 927bcaadda823899ee6f201166c0924e4e77ddb7 (diff) | |
| download | bcm5719-llvm-0adee9b362ac69c6fa6e809d5e99d78d5dc3c587.tar.gz bcm5719-llvm-0adee9b362ac69c6fa6e809d5e99d78d5dc3c587.zip  | |
Rename variable. add comment.
llvm-svn: 104274
| -rw-r--r-- | llvm/include/llvm/Analysis/DebugInfo.h | 2 | ||||
| -rw-r--r-- | llvm/lib/Analysis/DebugInfo.cpp | 7 | 
2 files changed, 6 insertions, 3 deletions
diff --git a/llvm/include/llvm/Analysis/DebugInfo.h b/llvm/include/llvm/Analysis/DebugInfo.h index b69b3babb53..473b127247f 100644 --- a/llvm/include/llvm/Analysis/DebugInfo.h +++ b/llvm/include/llvm/Analysis/DebugInfo.h @@ -677,7 +677,7 @@ namespace llvm {      DIVariable CreateVariable(unsigned Tag, DIDescriptor Context,                                StringRef Name,                                DIFile F, unsigned LineNo, -                              DIType Ty, bool OptimizedBuild = false); +                              DIType Ty, bool AlwaysPreserve = false);      /// CreateComplexVariable - Create a new descriptor for the specified      /// variable which has a complex address expression for its address. diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp index 194811be903..a7b6d2b65ee 100644 --- a/llvm/lib/Analysis/DebugInfo.cpp +++ b/llvm/lib/Analysis/DebugInfo.cpp @@ -1028,7 +1028,7 @@ DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context,                                       StringRef Name,                                       DIFile F,                                       unsigned LineNo, -                                     DIType Ty, bool OptimizedBuild) { +                                     DIType Ty, bool AlwaysPreserve) {    Value *Elts[] = {      GetTagConstant(Tag),      Context, @@ -1038,7 +1038,10 @@ DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context,      Ty,    };    MDNode *Node = MDNode::get(VMContext, &Elts[0], 6); -  if (OptimizedBuild) { +  if (AlwaysPreserve) { +    // The optimizer may remove local variable. If there is an interest +    // to preserve variable info in such situation then stash it in a +    // named mdnode.      NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.lv");      NMD->addOperand(Node);    }  | 

