diff options
author | Bill Wendling <isanbard@gmail.com> | 2010-09-15 21:03:06 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2010-09-15 21:03:06 +0000 |
commit | 19a50033ee55e77fbad4c45cf9628f259759a7ec (patch) | |
tree | b631590af854c0d5e111c5218caedc2032ad557b /lib | |
parent | ed70cc3e1ba3b7b511c1bd6d3358ba58cc0eae63 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_28@114020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 6 | ||||
-rw-r--r-- | lib/VMCore/AutoUpgrade.cpp | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index ee55ebbbc5..830c79aa3b 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1297,6 +1297,12 @@ bool BitcodeReader::ParseModule() { 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); diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp index fd64460d6f..9330e141c3 100644 --- a/lib/VMCore/AutoUpgrade.cpp +++ b/lib/VMCore/AutoUpgrade.cpp @@ -365,6 +365,18 @@ bool llvm::UpgradeIntrinsicFunction(Function *F, Function *&NewFn) { 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 |