From 83252dcfe61aaebcb6bc117e71dc12968729513f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 20 Jul 2010 21:07:09 +0000 Subject: Follow the implementation approach suggested by PR6687, which generates more efficient and more obviously conformant code. We now test for overflow of the multiply then force the result to -1 if so. On X86, this generates nice code like this: __Z4testl: ## @_Z4testl ## BB#0: ## %entry subl $12, %esp movl $4, %eax mull 16(%esp) testl %edx, %edx movl $-1, %ecx cmovel %eax, %ecx movl %ecx, (%esp) call __Znam addl $12, %esp ret git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108927 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenFunction.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/CodeGen/CodeGenFunction.h') diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 1a117cab96..f236eb4253 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -656,7 +656,7 @@ private: llvm::BasicBlock *TerminateLandingPad; llvm::BasicBlock *TerminateHandler; - llvm::BasicBlock *TrapBB, *ThrowLengthErrorBB; + llvm::BasicBlock *TrapBB; public: CodeGenFunction(CodeGenModule &cgm); @@ -1544,10 +1544,6 @@ public: /// generate a branch around the created basic block as necessary. llvm::BasicBlock *getTrapBB(); - /// getThrowLengthErrorBB - Create a basic block that will call - /// std::__throw_length_error to throw a std::length_error exception. - llvm::BasicBlock *getThrowLengthErrorBB(); - /// EmitCallArg - Emit a single call argument. RValue EmitCallArg(const Expr *E, QualType ArgType); -- cgit v1.2.3-18-g5258