Mercurial > projects > ldc
comparison gen/optimizer.cpp @ 1268:4ae3b3ceea11
Remove a bit of code duplication.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sun, 26 Apr 2009 20:36:53 +0200 |
parents | 381c3ee0ca00 |
children | bedf0bfb8fdb |
comparison
equal
deleted
inserted
replaced
1267:381c3ee0ca00 | 1268:4ae3b3ceea11 |
---|---|
144 ////////////////////////////////////////////////////////////////////////////////////////// | 144 ////////////////////////////////////////////////////////////////////////////////////////// |
145 // This function runs optimization passes based on command line arguments. | 145 // This function runs optimization passes based on command line arguments. |
146 // Returns true if any optimization passes were invoked. | 146 // Returns true if any optimization passes were invoked. |
147 bool ldc_optimize_module(llvm::Module* m) | 147 bool ldc_optimize_module(llvm::Module* m) |
148 { | 148 { |
149 if (!doInline() && optimizeLevel == 0 && passList.empty()) | 149 if (!optimize()) |
150 return false; | 150 return false; |
151 | 151 |
152 PassManager pm; | 152 PassManager pm; |
153 pm.add(new TargetData(m)); | 153 pm.add(new TargetData(m)); |
154 | 154 |