[llvm-commits] [dragonegg] r127993 - /dragonegg/trunk/Constants.cpp
Duncan Sands
baldrick at free.fr
Mon Mar 21 04:14:26 PDT 2011
Author: baldrick
Date: Mon Mar 21 06:14:25 2011
New Revision: 127993
URL: http://llvm.org/viewvc/llvm-project?rev=127993&view=rev
Log:
If there is no work to do then don't do any!
Modified:
dragonegg/trunk/Constants.cpp
Modified: dragonegg/trunk/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/Constants.cpp?rev=127993&r1=127992&r2=127993&view=diff
==============================================================================
--- dragonegg/trunk/Constants.cpp (original)
+++ dragonegg/trunk/Constants.cpp Mon Mar 21 06:14:25 2011
@@ -322,6 +322,9 @@
/// the first bit stored being 'StartingBit') and then loading out a (constant)
/// value of type 'Ty' from the stored to memory location.
Constant *InterpretAsType(Constant *C, const Type* Ty, unsigned StartingBit) {
+ if (C->getType() == Ty)
+ return C;
+
switch (Ty->getTypeID()) {
default:
llvm_unreachable("Unsupported type!");
More information about the llvm-commits
mailing list