[llvm-commits] [llvm] r58561 - /llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp

Duncan Sands baldrick at free.fr
Sun Nov 2 01:00:34 PST 2008


Author: baldrick
Date: Sun Nov  2 03:00:33 2008
New Revision: 58561

URL: http://llvm.org/viewvc/llvm-project?rev=58561&view=rev
Log:
Get this building on 64 bit machines (error:
cast from ‘const llvm::PointerType*’ to ‘unsigned int’
loses precision).

Modified:
    llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp

Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=58561&r1=58560&r2=58561&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Sun Nov  2 03:00:33 2008
@@ -80,8 +80,8 @@
   return new MergeFunctions();
 }
 
-static unsigned hash(const Function *F) {
-  return F->size() ^ reinterpret_cast<unsigned>(F->getType());
+static unsigned long hash(const Function *F) {
+  return F->size() ^ reinterpret_cast<unsigned long>(F->getType());
   //return F->size() ^ F->arg_size() ^ F->getReturnType();
 }
 
@@ -304,7 +304,7 @@
 bool MergeFunctions::runOnModule(Module &M) {
   bool Changed = false;
 
-  std::map<unsigned, std::vector<Function *> > FnMap;
+  std::map<unsigned long, std::vector<Function *> > FnMap;
 
   for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
     if (F->isDeclaration() || F->isIntrinsic())
@@ -326,8 +326,8 @@
   bool LocalChanged;
   do {
     LocalChanged = false;
-    for (std::map<unsigned, std::vector<Function *> >::iterator I = FnMap.begin(),
-           E = FnMap.end(); I != E; ++I) {
+    for (std::map<unsigned long, std::vector<Function *> >::iterator
+         I = FnMap.begin(), E = FnMap.end(); I != E; ++I) {
       DOUT << "size: " << FnMap.size() << "\n";
       std::vector<Function *> &FnVec = I->second;
       DOUT << "hash (" << I->first << "): " << FnVec.size() << "\n";





More information about the llvm-commits mailing list