[PATCH] CodeGen: Don't completely mess-up optimized atomic libcalls

Richard Smith richard at metafoo.co.uk
Thu Aug 28 18:32:08 PDT 2014


Seems legit.

================
Comment at: lib/CodeGen/CGAtomic.cpp:474-476
@@ -474,1 +473,5 @@
+    // Coerce the value into an appropriately sized integer type.
+    llvm::Type *ITy = llvm::IntegerType::get(CGF.getLLVMContext(), Size * 8);
+    Args.add(RValue::get(CGF.Builder.CreateBitCast(Val, ITy)),
+             CGF.getContext().getIntTypeForBitwidth(Size * 8, /*Signed=*/true));
   } else {
----------------
Use `ASTContext::toBits` instead of `8` here?

http://reviews.llvm.org/D5098






More information about the cfe-commits mailing list