Add a clear() method to PriorityQueue.
[oota-llvm.git] / lib / Transforms / IPO / ExtractGV.cpp
index 46232b880b1d797421580bbbf3d01693ac5d84dd..03a8e5cebca9173d1833e3b67b35dd7e5f208415 100644 (file)
@@ -123,10 +123,7 @@ namespace {
         if (std::find(Named.begin(), Named.end(), &*I) == Named.end()) {
           Function *New = Function::Create(I->getFunctionType(),
                                            GlobalValue::ExternalLinkage);
-          New->setCallingConv(I->getCallingConv());
-          New->setParamAttrs(I->getParamAttrs());
-          if (I->hasCollector())
-            New->setCollector(I->getCollector());
+          New->copyAttributesFrom(I);
 
           // If it's not the named function, delete the body of the function
           I->dropAllReferences();