[llvm-commits] [llvm] r148849 - /llvm/trunk/lib/Object/ELFObjectFile.cpp
Matt Beaumont-Gay
matthewbg at google.com
Tue Jan 24 11:43:30 PST 2012
Author: matthewbg
Date: Tue Jan 24 13:43:30 2012
New Revision: 148849
URL: http://llvm.org/viewvc/llvm-project?rev=148849&view=rev
Log:
Sink assert-only variables into the asserts
Modified:
llvm/trunk/lib/Object/ELFObjectFile.cpp
Modified: llvm/trunk/lib/Object/ELFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ELFObjectFile.cpp?rev=148849&r1=148848&r2=148849&view=diff
==============================================================================
--- llvm/trunk/lib/Object/ELFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/ELFObjectFile.cpp Tue Jan 24 13:43:30 2012
@@ -1672,14 +1672,11 @@
new DyldELFObject<support::little, true>(Object, MemoryMap, ec);
// Unit testing for type inquiry
- bool isBinary = isa<Binary>(result);
- bool isDyld = isa<DyldELFObject<support::little, true> >(result);
- bool isFile = isa<ELFObjectFile<support::little, true> >(result);
- (void)isBinary;
- (void)isDyld;
- (void)isFile;
- assert(isBinary && isDyld && isFile &&
- "Type inquiry failed for ELF object!");
+ assert(isa<Binary>(result) && "Type inquiry failed for ELF object!");
+ assert((isa<DyldELFObject<support::little, true> >(result)) &&
+ "Type inquiry failed for ELF object!");
+ assert((isa<ELFObjectFile<support::little, true> >(result)) &&
+ "Type inquiry failed for ELF object!");
return result;
}
}
@@ -1695,14 +1692,11 @@
new ELFObjectFile<support::little, true>(Object, ec);
// Unit testing for type inquiry
- bool isBinary = isa<Binary>(result);
- bool isDyld = isa<DyldELFObject<support::little, true> >(result);
- bool isFile = isa<ELFObjectFile<support::little, true> >(result);
- (void)isBinary;
- (void)isDyld;
- (void)isFile;
- assert(isBinary && isFile && !isDyld &&
- "Type inquiry failed for ELF object!");
+ assert(isa<Binary>(result) && "Type inquiry failed for ELF object!");
+ assert((!isa<DyldELFObject<support::little, true> >(result)) &&
+ "Type inquiry failed for ELF object!");
+ assert((isa<ELFObjectFile<support::little, true> >(result)) &&
+ "Type inquiry failed for ELF object!");
return result;
}
More information about the llvm-commits
mailing list