[llvm-commits] [dragonegg] r92716 - /dragonegg/trunk/llvm-convert.cpp
Duncan Sands
baldrick at free.fr
Tue Jan 5 00:26:25 PST 2010
Author: baldrick
Date: Tue Jan 5 02:26:25 2010
New Revision: 92716
URL: http://llvm.org/viewvc/llvm-project?rev=92716&view=rev
Log:
Port commit 91955 (echristo) from llvm-gcc:
Update llvm-convert for bitcode changes. Convert last argument to
a boolean.
Modified:
dragonegg/trunk/llvm-convert.cpp
Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=92716&r1=92715&r2=92716&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Tue Jan 5 02:26:25 2010
@@ -4465,9 +4465,20 @@
return false;
}
+ // LLVM doesn't handle type 1 or type 3. Deal with that here.
+ Value *Tmp = EmitRegister(gimple_call_arg(stmt, 1));
+
+ ConstantInt *CI = cast<ConstantInt>(Tmp);
+
+ // Clear the bottom bit since we only handle whole objects and shift to turn
+ // the second bit into our boolean.
+ uint64_t val = (CI->getZExtValue() & 0x2) >> 1;
+
+ Value *NewTy = ConstantInt::get(Tmp->getType(), val);
+
Value* Args[] = {
EmitRegister(gimple_call_arg(stmt, 0)),
- EmitRegister(gimple_call_arg(stmt, 1))
+ NewTy
};
// Grab the current return type.
More information about the llvm-commits
mailing list