comparison gen/linker.cpp @ 393:a3f3c2770a0d

Added bitcode filename to very verbose logging. Fixed -O<n> switches from llvm 2.4. Removed md5 from the kdevelop project filelist.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sat, 26 Jul 2008 15:02:57 +0200
parents 6788e98ec1cd
children 723027dd9593
comparison
equal deleted inserted replaced
392:869d08aaf336 393:a3f3c2770a0d
106 { 106 {
107 const char* s = 0; 107 const char* s = 0;
108 switch(global.params.optimizeLevel) 108 switch(global.params.optimizeLevel)
109 { 109 {
110 case 0: 110 case 0:
111 s = "-O0"; break; 111 args.push_back("-disable-opt");
112 args.push_back("-globaldce");
113 break;
112 case 1: 114 case 1:
113 s = "-O1"; break; 115 args.push_back("-disable-opt");
116 args.push_back("-globaldce");
117 args.push_back("-mem2reg");
114 case 2: 118 case 2:
115 s = "-O2"; break;
116 case 3: 119 case 3:
117 s = "-O3"; break;
118 case 4: 120 case 4:
119 s = "-O4"; break;
120 case 5: 121 case 5:
121 s = "-O5"; break; 122 // use default optimization
123 break;
122 default: 124 default:
123 assert(0); 125 assert(0);
124 } 126 }
125 args.push_back(s);
126 } 127 }
127 128
128 // inlining 129 // inlining
129 if (!(global.params.useInline || global.params.llvmInline)) 130 if (!(global.params.useInline || global.params.llvmInline))
130 { 131 {
153 if(global.params.isLinux) 154 if(global.params.isLinux)
154 { 155 {
155 args.push_back("-lpthread"); 156 args.push_back("-lpthread");
156 args.push_back("-ldl"); 157 args.push_back("-ldl");
157 args.push_back("-lm"); 158 args.push_back("-lm");
159 }
160 else if (global.params.isWindows)
161 {
162 // FIXME: I'd assume kernel32 etc
158 } 163 }
159 164
160 // object files 165 // object files
161 for (int i = 0; i < global.params.objfiles->dim; i++) 166 for (int i = 0; i < global.params.objfiles->dim; i++)
162 { 167 {