[llvm-branch-commits] [llvm-branch] r85820 - in /llvm/branches/Apple/Leela/lib: Transforms/IPO/StripSymbols.cpp VMCore/Metadata.cpp

Bill Wendling isanbard at gmail.com
Mon Nov 2 11:38:33 PST 2009


Author: void
Date: Mon Nov  2 13:38:33 2009
New Revision: 85820

URL: http://llvm.org/viewvc/llvm-project?rev=85820&view=rev
Log:
$ svn merge -c 85130 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r85130 into '.':
U    lib/VMCore/Metadata.cpp
$ svn merge -c 85402 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r85402 into '.':
U    lib/Transforms/IPO/StripSymbols.cpp


Modified:
    llvm/branches/Apple/Leela/lib/Transforms/IPO/StripSymbols.cpp
    llvm/branches/Apple/Leela/lib/VMCore/Metadata.cpp

Modified: llvm/branches/Apple/Leela/lib/Transforms/IPO/StripSymbols.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/Transforms/IPO/StripSymbols.cpp?rev=85820&r1=85819&r2=85820&view=diff

==============================================================================
--- llvm/branches/Apple/Leela/lib/Transforms/IPO/StripSymbols.cpp (original)
+++ llvm/branches/Apple/Leela/lib/Transforms/IPO/StripSymbols.cpp Mon Nov  2 13:38:33 2009
@@ -290,15 +290,6 @@
     Declare->eraseFromParent();
   }
 
-  // Delete all llvm.dbg.global_variables.
-  for (Module::global_iterator I = M.global_begin(), E = M.global_end(); 
-       I != E; ++I) {
-    GlobalVariable *GV = dyn_cast<GlobalVariable>(I);
-    if (!GV) continue;
-    if (GV->use_empty() && GV->getName().startswith("llvm.dbg.global_variable"))
-      DeadConstants.push_back(GV);
-  }
-
   while (!DeadConstants.empty()) {
     Constant *C = DeadConstants.back();
     DeadConstants.pop_back();

Modified: llvm/branches/Apple/Leela/lib/VMCore/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/VMCore/Metadata.cpp?rev=85820&r1=85819&r2=85820&view=diff

==============================================================================
--- llvm/branches/Apple/Leela/lib/VMCore/Metadata.cpp (original)
+++ llvm/branches/Apple/Leela/lib/VMCore/Metadata.cpp Mon Nov  2 13:38:33 2009
@@ -356,20 +356,22 @@
   MDStoreTy::iterator I = MetadataStore.find(Inst);
   if (I == MetadataStore.end())
     return;
+  MDs.resize(I->second.size());
   for (MDMapTy::iterator MI = I->second.begin(), ME = I->second.end();
        MI != ME; ++MI)
-    MDs.push_back(std::make_pair(MI->first, MI->second));
-  std::sort(MDs.begin(), MDs.end());
+    // MD kinds are numbered from 1.
+    MDs[MI->first - 1] = std::make_pair(MI->first, MI->second);
 }
 
 /// getHandlerNames - Populate client supplied smallvector using custome
 /// metadata name and ID.
 void MetadataContextImpl::
 getHandlerNames(SmallVectorImpl<std::pair<unsigned, StringRef> >&Names) const {
+  Names.resize(MDHandlerNames.size());
   for (StringMap<unsigned>::const_iterator I = MDHandlerNames.begin(),
          E = MDHandlerNames.end(); I != E; ++I) 
-    Names.push_back(std::make_pair(I->second, I->first()));
-  std::sort(Names.begin(), Names.end());
+    // MD Handlers are numbered from 1.
+    Names[I->second - 1] = std::make_pair(I->second, I->first());
 }
 
 /// ValueIsCloned - This handler is used to update metadata store





More information about the llvm-branch-commits mailing list