canonicalize namespace gymnastics
authorChris Lattner <sabre@nondot.org>
Wed, 9 Sep 2009 23:46:42 +0000 (23:46 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 9 Sep 2009 23:46:42 +0000 (23:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81402 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCDisassembler.cpp
lib/Support/MemoryObject.cpp

index 29af019ec55a9bf1a5552d477337d39fdfd187c1..5d0f4c503463f39f74f90edbf761bd9ccbf34602 100644 (file)
@@ -8,9 +8,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/MC/MCDisassembler.h"
+using namespace llvm;
 
-llvm::MCDisassembler::MCDisassembler() {
+MCDisassembler::MCDisassembler() {
 }
   
-llvm::MCDisassembler::~MCDisassembler() {
+MCDisassembler::~MCDisassembler() {
 }
\ No newline at end of file
index 08e5fb75b3a9724fedc801c1dea286e74e7aab4a..91e3ecd23a2e7f807c6840a43d7215b8c03e4419 100644 (file)
@@ -1,4 +1,4 @@
-//===- MemoryObject.cpp - Abstract memory interface -------------*- C++ -*-===//
+//===- MemoryObject.cpp - Abstract memory interface -----------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,30 +8,27 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Support/MemoryObject.h"
-
-namespace llvm {
+using namespace llvm;
   
-  MemoryObject::~MemoryObject() {
-  }
+MemoryObject::~MemoryObject() {
+}
+
+int MemoryObject::readBytes(uint64_t address,
+                            uint64_t size,
+                            uint8_t* buf,
+                            uint64_t* copied) const {
+  uint64_t current = address;
+  uint64_t limit = getBase() + getExtent();
   
-  int MemoryObject::readBytes(uint64_t address,
-                              uint64_t size,
-                              uint8_t* buf,
-                              uint64_t* copied) const {
-    uint64_t current = address;
-    uint64_t limit = getBase() + getExtent();
-    
-    while (current - address < size && current < limit) {
-      if (readByte(current, &buf[(current - address)]))
-        return -1;
-      
-      current++;
-    }
+  while (current - address < size && current < limit) {
+    if (readByte(current, &buf[(current - address)]))
+      return -1;
     
-    if (copied)
-      *copied = current - address;
-    
-    return 0;
+    current++;
   }
-
+  
+  if (copied)
+    *copied = current - address;
+  
+  return 0;
 }