@@ -126,6 +126,7 @@ is still disabled, so there is no need to do anything special with source locati
126126
127127
128128use driver:: session;
129+ use driver:: session:: { FullDebugInfo , LimitedDebugInfo , NoDebugInfo } ;
129130use lib:: llvm:: llvm;
130131use lib:: llvm:: { ModuleRef , ContextRef , ValueRef } ;
131132use lib:: llvm:: debuginfo:: * ;
@@ -530,7 +531,7 @@ pub fn create_function_debug_context(cx: &CrateContext,
530531 fn_ast_id : ast:: NodeId ,
531532 param_substs : Option < @param_substs > ,
532533 llfn : ValueRef ) -> FunctionDebugContext {
533- if ! cx. sess . opts . debuginfo {
534+ if cx. sess . opts . debuginfo == NoDebugInfo {
534535 return DebugInfoDisabled ;
535536 }
536537
@@ -706,7 +707,7 @@ pub fn create_function_debug_context(cx: &CrateContext,
706707 fn_decl : & ast:: FnDecl ,
707708 param_substs : Option < @param_substs > ,
708709 error_span : Span ) -> DIArray {
709- if ! cx. sess . opts . debuginfo {
710+ if cx. sess . opts . debuginfo == LimitedDebugInfo {
710711 return create_DIArray ( DIB ( cx) , [ ] ) ;
711712 }
712713
@@ -783,8 +784,8 @@ pub fn create_function_debug_context(cx: &CrateContext,
783784 name_to_append_suffix_to. push_str ( "," ) ;
784785 }
785786
786- // Only create type information if debuginfo is enabled
787- if cx. sess . opts . debuginfo {
787+ // Only create type information if full debuginfo is enabled
788+ if cx. sess . opts . debuginfo == FullDebugInfo {
788789 let actual_self_type_metadata = type_metadata ( cx,
789790 actual_self_type,
790791 codemap:: DUMMY_SP ) ;
@@ -827,8 +828,8 @@ pub fn create_function_debug_context(cx: &CrateContext,
827828 name_to_append_suffix_to. push_str ( "," ) ;
828829 }
829830
830- // Again, only create type information if debuginfo is enabled
831- if cx. sess . opts . debuginfo {
831+ // Again, only create type information if full debuginfo is enabled
832+ if cx. sess . opts . debuginfo == FullDebugInfo {
832833 let actual_type_metadata = type_metadata ( cx, actual_type, codemap:: DUMMY_SP ) ;
833834 let param_metadata = token:: get_ident ( ident) . get ( )
834835 . with_c_str ( |name| {
0 commit comments