aboutsummaryrefslogtreecommitdiff
path: root/lib/Object
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-02-28 20:26:17 +0000
committerEric Christopher <echristo@gmail.com>2013-02-28 20:26:17 +0000
commitb3e6b04aea9d12183b97770f7b250622e78fe7f1 (patch)
treeb93b117565e2c7d6b2052863cad943f3bf791d57 /lib/Object
parent19949d8b867013d8a0ef90ac6d3051c49a92eef5 (diff)
Move an assert earlier in a file and check that the result of
our bitwise compare is equal to the field we're looking for. Noticed on inspection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176296 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object')
-rw-r--r--lib/Object/MachOObjectFile.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp
index eb1690e659..6501df9fb9 100644
--- a/lib/Object/MachOObjectFile.cpp
+++ b/lib/Object/MachOObjectFile.cpp
@@ -1304,14 +1304,17 @@ StringRef MachOObjectFile::getFileFormatName() const {
}
}
+ // Make sure the cpu type has the correct mask.
+ assert((MachOObj->getHeader().CPUType & llvm::MachO::CPUArchABI64)
+ == llvm::MachO::CPUArchABI64 &&
+ "32-bit object file when we're 64-bit?");
+
switch (MachOObj->getHeader().CPUType) {
case llvm::MachO::CPUTypeX86_64:
return "Mach-O 64-bit x86-64";
case llvm::MachO::CPUTypePowerPC64:
return "Mach-O 64-bit ppc64";
default:
- assert((MachOObj->getHeader().CPUType & llvm::MachO::CPUArchABI64) == 1 &&
- "32-bit object file when we're 64-bit?");
return "Mach-O 64-bit unknown";
}
}