This repository was archived by the owner on Jun 20, 2019. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 2424	(build_closure): Don't set chain field for functions without context
2525	pointer.
2626
27+ 2018-01-21  Iain Buclaw  <
[email protected] >
28+ 
29+ 	* decls.cc (get_symbol_decl): Handle pragma(inline) attributes.
30+ 
27312018-01-21  Iain Buclaw  <
[email protected] >
2832
2933	* decl.cc (DeclVisitor::visit(StructDeclaration)): Mark compiler
Original file line number Diff line number Diff line change @@ -1131,8 +1131,16 @@ get_symbol_decl (Declaration *decl)
11311131	  d_keep  (newfntype);
11321132	}
11331133
1134-       /*  Miscellaneous function flags.  */ 
1135-       if  (fd->isMember2  () || fd->isFuncLiteralDeclaration  ())
1134+       /*  In [pragma/inline], The attribute pragma(inline) affects whether a
1135+ 	 function should be inlined or not.  */  
1136+       if  (fd->inlining  == PINLINEnever)
1137+ 	DECL_UNINLINABLE  (decl->csym ) = 1 ;
1138+       else  if  (fd->inlining  == PINLINEalways)
1139+ 	{
1140+ 	  DECL_DECLARED_INLINE_P  (decl->csym ) = 1 ;
1141+ 	  DECL_DISREGARD_INLINE_LIMITS  (decl->csym ) = 1 ;
1142+ 	}
1143+       else  if  (fd->isMember2  () || fd->isFuncLiteralDeclaration  ())
11361144	{
11371145	  /*  See grokmethod in cp/decl.c.  Maybe we shouldn't be setting inline
11381146	     flags without reason or proper handling.  */  
@@ -1240,6 +1248,16 @@ get_symbol_decl (Declaration *decl)
12401248	  else 
12411249	    DECL_EXTERNAL  (decl->csym ) = 1 ;
12421250	}
1251+ 
1252+       /*  Don't keep functions declared pragma(inline, true) unless
1253+ 	 the user wants us to keep all inline functions.  */  
1254+       if  (fd && fd->inlining  == PINLINEalways && TREE_PUBLIC  (decl->csym ))
1255+ 	{
1256+ 	  if  (flag_keep_inline_functions)
1257+ 	    mark_needed  (decl->csym );
1258+ 
1259+ 	  DECL_COMDAT  (decl->csym ) = 1 ;
1260+ 	}
12431261    }
12441262
12451263  /*  Symbol is going in thread local storage.  */ 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments