* fixed a number of (mostly false) warnings regarding uninitialised

variables with -Oodfa

git-svn-id: branches/hlcgllvm@30244 -
This commit is contained in:
Jonas Maebe 2015-03-15 21:10:50 +00:00
parent bc7ba58798
commit 765044aede
9 changed files with 24 additions and 2 deletions

View File

@ -997,7 +997,9 @@ implementation
datatcb.emit_tai(Tai_label.Create(result.lab),widecharpointertype); datatcb.emit_tai(Tai_label.Create(result.lab),widecharpointertype);
{ allocate a separate label for the start of the data } { allocate a separate label for the start of the data }
current_asmdata.getdatalabel(startlab); current_asmdata.getdatalabel(startlab);
end; end
else
internalerror(2015031502);
result.ofs:=string_symofs; result.ofs:=string_symofs;
end end
else else

View File

@ -849,6 +849,9 @@ implementation
invert:=a=0; invert:=a=0;
OC_NE: OC_NE:
invert:=a=1; invert:=a=1;
else
{ avoid uninitialised warning }
internalerror(2015031504);
end; end;
current_asmdata.getjumplabel(falselab); current_asmdata.getjumplabel(falselab);
fallthroughlab:=falselab; fallthroughlab:=falselab;

View File

@ -77,6 +77,7 @@ interface
); );
llvm_fpcond2str: array[tllvmfpcmp] of ansistring = ( llvm_fpcond2str: array[tllvmfpcmp] of ansistring = (
'invalid',
'false', 'false',
'oeq', 'ogt', 'oge', 'olt', 'ole', 'one', 'ord', 'oeq', 'ogt', 'oge', 'olt', 'ole', 'one', 'ord',
'ueq', 'ugt', 'uge', 'ult', 'ule', 'une', 'uno', 'ueq', 'ugt', 'uge', 'ult', 'ule', 'une', 'uno',

View File

@ -84,6 +84,7 @@ interface
type type
tllvmfpcmp = ( tllvmfpcmp = (
lfc_invalid,
lfc_false, lfc_false,
lfc_oeq, lfc_ogt, lfc_oge, lfc_olt, lfc_ole, lfc_one, lfc_ord, lfc_oeq, lfc_ogt, lfc_oge, lfc_olt, lfc_ole, lfc_one, lfc_ord,
lfc_ueq, lfc_ugt, lfc_uge, lfc_ult, lfc_ule, lfc_une, lfc_uno, lfc_ueq, lfc_ugt, lfc_uge, lfc_ult, lfc_ule, lfc_une, lfc_uno,

View File

@ -166,6 +166,8 @@ implementation
cmpop:=OC_EQ; cmpop:=OC_EQ;
unequaln: unequaln:
cmpop:=OC_NE; cmpop:=OC_NE;
else
internalerror(2015031505);
end; end;
if nf_swapped in flags then if nf_swapped in flags then
cmpop:=swap_opcmp(cmpop); cmpop:=swap_opcmp(cmpop);
@ -206,6 +208,8 @@ implementation
cmpop:=false; cmpop:=false;
singleprec:=tfloatdef(left.resultdef).floattype=s32real; singleprec:=tfloatdef(left.resultdef).floattype=s32real;
{ avoid uninitialised warning }
llvmfpcmp:=lfc_invalid;
case nodetype of case nodetype of
addn : addn :
op:=la_fadd; op:=la_fadd;
@ -233,6 +237,8 @@ implementation
llvmfpcmp:=lfc_oeq; llvmfpcmp:=lfc_oeq;
unequaln: unequaln:
llvmfpcmp:=lfc_one; llvmfpcmp:=lfc_one;
else
internalerror(2015031506);
end; end;
end; end;
else else

View File

@ -140,6 +140,8 @@ implementation
locref:=nil; locref:=nil;
if not arraytopointerconverted then if not arraytopointerconverted then
begin begin
{ avoid uninitialised warning }
arrptrelementdef:=nil;
{ the result is currently a pointer to left.resultdef (the array type) { the result is currently a pointer to left.resultdef (the array type)
-> convert it into a pointer to an element inside this array } -> convert it into a pointer to an element inside this array }
getarrelementptrdef; getarrelementptrdef;
@ -153,6 +155,8 @@ implementation
if (resultdef.typ=floatdef) and if (resultdef.typ=floatdef) and
(tfloatdef(resultdef).floattype=s80real) then (tfloatdef(resultdef).floattype=s80real) then
begin begin
{ avoid uninitialised warning }
arrptrelementdef:=nil;
getarrelementptrdef; getarrelementptrdef;
hreg:=hlcg.getaddressregister(current_asmdata.CurrAsmList,getpointerdef(resultdef)); hreg:=hlcg.getaddressregister(current_asmdata.CurrAsmList,getpointerdef(resultdef));
hlcg.a_load_reg_reg(current_asmdata.CurrAsmList,arrptrelementdef,getpointerdef(resultdef),locref^.base,hreg); hlcg.a_load_reg_reg(current_asmdata.CurrAsmList,arrptrelementdef,getpointerdef(resultdef),locref^.base,hreg);

View File

@ -109,7 +109,10 @@ implementation
begin begin
oldfileinfo:=current_filepos; oldfileinfo:=current_filepos;
current_filepos:=current_procinfo.procdef.fileinfo; current_filepos:=current_procinfo.procdef.fileinfo;
end; end
else
{ avoid uninitialised warning later }
oldfileinfo.line:=0;
alloclist.concat(taillvm.op_ref_size(la_alloca,ref,def)); alloclist.concat(taillvm.op_ref_size(la_alloca,ref,def));
if assigned(current_procinfo) then if assigned(current_procinfo) then
current_filepos:=oldfileinfo; current_filepos:=oldfileinfo;

View File

@ -565,6 +565,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
begin begin
ll.lab:=nil; ll.lab:=nil;
ll.ofs:=0; ll.ofs:=0;
winlike:=false;
end end
else else
begin begin

View File

@ -4052,6 +4052,7 @@ implementation
inherited create(n,recorddef); inherited create(n,recorddef);
{ if we specified a name, then we'll probably want to look up the { if we specified a name, then we'll probably want to look up the
type again by name too -> create typesym } type again by name too -> create typesym }
ts:=nil;
if definedname then if definedname then
begin begin
ts:=ctypesym.create(n,self); ts:=ctypesym.create(n,self);