Don't use a potentially expensive shift if all we want is one set bit.
[oota-llvm.git] / tools / llvm-rtdyld / llvm-rtdyld.cpp
index 8b71a4f364128f2c9c647661739f34f36003f076..b68f2a08d92726d4baf7fd936f2afeb6357cacc9 100644 (file)
@@ -17,7 +17,7 @@
 #include "llvm/ExecutionEngine/ObjectBuffer.h"
 #include "llvm/ExecutionEngine/ObjectImage.h"
 #include "llvm/ExecutionEngine/RuntimeDyld.h"
-#include "llvm/Object/MachOObject.h"
+#include "llvm/Object/MachO.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/Memory.h"
@@ -69,7 +69,7 @@ public:
     return 0;
   }
 
-  bool applyPermissions(std::string *ErrMsg) { return false; }
+  bool finalizeMemory(std::string *ErrMsg) { return false; }
 
   // Invalidate instruction cache for sections with execute permissions.
   // Some platforms with separate data cache and instruction cache require
@@ -163,8 +163,14 @@ static int printLineInfoForInput() {
 
         outs() << "Function: " << Name << ", Size = " << Size << "\n";
 
-        DILineInfo Result = Context->getLineInfoForAddress(Addr);
-        outs() << "  Line info:" << Result.getFileName() << ", line:" << Result.getLine() << "\n";
+        DILineInfoTable Lines = Context->getLineInfoForAddressRange(Addr, Size);
+        DILineInfoTable::iterator  Begin = Lines.begin();
+        DILineInfoTable::iterator  End = Lines.end();
+        for (DILineInfoTable::iterator It = Begin; It != End; ++It) {
+          outs() << "  Line info @ " << It->first - Addr << ": "
+                 << It->second.getFileName()
+                 << ", line:" << It->second.getLine() << "\n";
+        }
       }
     }
   }