Fix a bug that prevented llvm-extract -delete from working.
authorDan Gohman <gohman@apple.com>
Tue, 21 Oct 2008 01:08:07 +0000 (01:08 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 21 Oct 2008 01:08:07 +0000 (01:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57864 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/ExtractGV.cpp

index d409b6e8067e0dc4ad7f6e780d9dca8e0e42cf16..79e51d0332c4d2a58966ec88f3c9464676a2f806 100644 (file)
@@ -52,7 +52,7 @@ namespace {
     bool deleteGV() {
       for (std::vector<GlobalValue*>::iterator GI = Named.begin(), 
              GE = Named.end(); GI != GE; ++GI) {
-        if (Function* NamedFunc = dyn_cast<Function>(&*GI)) {
+        if (Function* NamedFunc = dyn_cast<Function>(*GI)) {
          // If we're in relinking mode, set linkage of all internal callees to
          // external. This will allow us extract function, and then - link
          // everything together