From 50a1fdb6b47f188f4ff95ce44caf0e6f1f44b62b Mon Sep 17 00:00:00 2001 From: sewardj Date: Thu, 13 Jan 2000 15:25:39 +0000 Subject: [PATCH] [project @ 2000-01-13 15:25:39 by sewardj] genCodeInfoTable: don't do getSRTInfo on the closure info if we already know via infoTblNeedsSRT that an SRT isn't needed. --- ghc/compiler/nativeGen/StixInfo.lhs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ghc/compiler/nativeGen/StixInfo.lhs b/ghc/compiler/nativeGen/StixInfo.lhs index 17bbf98..3bf427e 100644 --- a/ghc/compiler/nativeGen/StixInfo.lhs +++ b/ghc/compiler/nativeGen/StixInfo.lhs @@ -42,10 +42,11 @@ genCodeInfoTable (CClosureInfoAndCode cl_info _ _ cl_descr) = returnUs (\xs -> StData PtrRep table : StLabel info_lbl : xs) where - info_lbl = infoTableLabelFromCI cl_info + info_lbl = infoTableLabelFromCI cl_info + needs_srt = infoTblNeedsSRT cl_info - table | infoTblNeedsSRT cl_info = srt_label : rest_of_table - | otherwise = rest_of_table + table | needs_srt = srt_label : rest_of_table + | otherwise = rest_of_table rest_of_table = [ @@ -68,12 +69,14 @@ genCodeInfoTable (CClosureInfoAndCode cl_info _ _ cl_descr) #endif srt = getSRTInfo cl_info - (srt_label,srt_len) = - case srt of - (lbl, NoSRT) -> (StInt 0, 0) + (srt_label,srt_len) + | needs_srt + = case srt of (lbl, SRT off len) -> (StIndex DataPtrRep (StCLbl lbl) (StInt (toInteger off)), len) + | otherwise + = (StInt 0, 0) layout_info :: Word32 #ifdef WORDS_BIGENDIAN -- 1.7.10.4