aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/MachOObjectFile.cpp
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
commit0ac16d539c14fea155f8d61d499d5ac5244403ba (patch)
tree8c65fed11ccc26582a5be675f9f85f962a733c41 /llvm/lib/Object/MachOObjectFile.cpp
parent4b8075255040c2e1c41b49dce6e005ab2d4d7efc (diff)
downloadllvm-0ac16d539c14fea155f8d61d499d5ac5244403ba.zip
llvm-0ac16d539c14fea155f8d61d499d5ac5244403ba.tar.gz
llvm-0ac16d539c14fea155f8d61d499d5ac5244403ba.tar.bz2
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. llvm-svn: 176296
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index eb1690e..6501df9 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/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";
}
}