[llvm-branch-commits] [llvm-branch] r114020 - in /llvm/branches/release_28: ./ include/llvm/AutoUpgrade.h lib/Bitcode/Reader/BitcodeReader.cpp lib/VMCore/AutoUpgrade.cpp test/Bitcode/AutoUpgradeGlobals.ll test/Bitcode/AutoUpgradeGlobals.ll.bc

Bill Wendling isanbard at gmail.com
Wed Sep 15 14:03:10 PDT 2010


Author: void
Date: Wed Sep 15 16:03:06 2010
New Revision: 114020

URL: http://llvm.org/viewvc/llvm-project?rev=114020&view=rev
Log:
Merge AutoUpgrade of EH magic variable.

$ svn merge -c 113600 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r113600 into '.':
A    test/Bitcode/AutoUpgradeGlobals.ll
A    test/Bitcode/AutoUpgradeGlobals.ll.bc
U    include/llvm/AutoUpgrade.h
U    lib/Bitcode/Reader/BitcodeReader.cpp
U    lib/VMCore/AutoUpgrade.cpp
$ svn merge -c 113603 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r113603 into '.':
G    lib/VMCore/AutoUpgrade.cpp
$ svn merge -c 113615 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r113615 into '.':
G    lib/VMCore/AutoUpgrade.cpp


Added:
    llvm/branches/release_28/test/Bitcode/AutoUpgradeGlobals.ll
      - copied unchanged from r113600, llvm/trunk/test/Bitcode/AutoUpgradeGlobals.ll
    llvm/branches/release_28/test/Bitcode/AutoUpgradeGlobals.ll.bc
      - copied unchanged from r113600, llvm/trunk/test/Bitcode/AutoUpgradeGlobals.ll.bc
Modified:
    llvm/branches/release_28/   (props changed)
    llvm/branches/release_28/include/llvm/AutoUpgrade.h
    llvm/branches/release_28/lib/Bitcode/Reader/BitcodeReader.cpp
    llvm/branches/release_28/lib/VMCore/AutoUpgrade.cpp

Propchange: llvm/branches/release_28/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 15 16:03:06 2010
@@ -1,2 +1,2 @@
 /llvm/branches/Apple/Pertwee:110850,110961
-/llvm/trunk:113057,113109,113123,113146,113158,113255,113257,113260,113297,113299,113303,113322,113345,113365-113366,113394,113483-113485,113557,113576,113637,113764,113820,113828,113848,113894,113911
+/llvm/trunk:113057,113109,113123,113146,113158,113255,113257,113260,113297,113299,113303,113322,113345,113365-113366,113394,113483-113485,113557,113576,113600,113603,113615,113637,113764,113820,113828,113848,113894,113911

Modified: llvm/branches/release_28/include/llvm/AutoUpgrade.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_28/include/llvm/AutoUpgrade.h?rev=114020&r1=114019&r2=114020&view=diff
==============================================================================
--- llvm/branches/release_28/include/llvm/AutoUpgrade.h (original)
+++ llvm/branches/release_28/include/llvm/AutoUpgrade.h Wed Sep 15 16:03:06 2010
@@ -16,6 +16,7 @@
 
 namespace llvm {
   class Module;
+  class GlobalVariable;
   class Function;
   class CallInst;
 
@@ -35,6 +36,10 @@
   /// so that it can update all calls to the old function.
   void UpgradeCallsToIntrinsic(Function* F);
 
+  /// This checks for global variables which should be upgraded. It returns true
+  /// if it requires upgrading.
+  bool UpgradeGlobalVariable(GlobalVariable *GV);
+
   /// This function checks debug info intrinsics. If an intrinsic is invalid
   /// then this function simply removes the intrinsic. 
   void CheckDebugInfoIntrinsics(Module *M);

Modified: llvm/branches/release_28/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_28/lib/Bitcode/Reader/BitcodeReader.cpp?rev=114020&r1=114019&r2=114020&view=diff
==============================================================================
--- llvm/branches/release_28/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/branches/release_28/lib/Bitcode/Reader/BitcodeReader.cpp Wed Sep 15 16:03:06 2010
@@ -1297,6 +1297,12 @@
           UpgradedIntrinsics.push_back(std::make_pair(FI, NewFn));
       }
 
+      // Look for global variables which need to be renamed.
+      for (Module::global_iterator
+             GI = TheModule->global_begin(), GE = TheModule->global_end();
+           GI != GE; ++GI)
+        UpgradeGlobalVariable(GI);
+
       // Force deallocation of memory for these vectors to favor the client that
       // want lazy deserialization.
       std::vector<std::pair<GlobalVariable*, unsigned> >().swap(GlobalInits);

Modified: llvm/branches/release_28/lib/VMCore/AutoUpgrade.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_28/lib/VMCore/AutoUpgrade.cpp?rev=114020&r1=114019&r2=114020&view=diff
==============================================================================
--- llvm/branches/release_28/lib/VMCore/AutoUpgrade.cpp (original)
+++ llvm/branches/release_28/lib/VMCore/AutoUpgrade.cpp Wed Sep 15 16:03:06 2010
@@ -365,6 +365,18 @@
   return Upgraded;
 }
 
+bool llvm::UpgradeGlobalVariable(GlobalVariable *GV) {
+  StringRef Name(GV->getName());
+
+  // We are only upgrading one symbol here.
+  if (Name == ".llvm.eh.catch.all.value") {
+    GV->setName("llvm.eh.catch.all.value");
+    return true;
+  }
+
+  return false;
+}
+
 /// ExtendNEONArgs - For NEON "long" and "wide" operations, where the results
 /// have vector elements twice as big as one or both source operands, do the
 /// sign- or zero-extension that used to be handled by intrinsics.  The





More information about the llvm-branch-commits mailing list