Fix a dangling StringRef bug in the auto upgrader. In one case, we reset
authorChandler Carruth <chandlerc@gmail.com>
Fri, 20 Jul 2012 21:09:18 +0000 (21:09 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 20 Jul 2012 21:09:18 +0000 (21:09 +0000)
commit7325f06051bab14196ab3701d515f5b110cefe26
tree5b58a9d157fa3b61d70bebe8da71af7a107e40c3
parentc321a20b2e250a755bd06f36d896d00d9fd396ad
Fix a dangling StringRef bug in the auto upgrader. In one case, we reset
CI's name, and then used the StringRef pointing at its old name. I'm
fixing it by storing the name in a std::string, and hoisting the
renaming logic to happen always. This is nicer anyways as it will allow
the upgraded IR to have the same names as the input IR in more cases.

Another bug found by AddressSanitizer. Woot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160572 91177308-0d34-0410-b5e6-96231b3b80d8
lib/VMCore/AutoUpgrade.cpp