about summary refs log tree commit diff
diff options
context:
space:
mode:
authortempdragon <88025134+tempdragon@users.noreply.github.com>2024-02-29 01:10:51 +0800
committerGitHub <noreply@github.com>2024-02-29 01:10:51 +0800
commit51cd5f1c78462860890da4487616569400369378 (patch)
tree80fa26d278129959c75a06399cac3179866b2111
parent09fd9087b6ee5245e5b87fdb2dd48e7770c41fd6 (diff)
downloadrust-51cd5f1c78462860890da4487616569400369378.tar.gz
rust-51cd5f1c78462860890da4487616569400369378.zip
fix(code fmt): Apply style suggestions from code review
Co-authored-by: antoyo <antoyo@users.noreply.github.com>
-rw-r--r--src/context.rs2
-rw-r--r--src/debuginfo.rs14
-rw-r--r--src/lib.rs2
3 files changed, 8 insertions, 10 deletions
diff --git a/src/context.rs b/src/context.rs
index 9dbb3751d47..cca37168880 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -345,7 +345,7 @@ impl<'gcc, 'tcx> BackendTypes for CodegenCx<'gcc, 'tcx> {
     type Funclet = (); // TODO(antoyo)
 
     type DIScope = (); // TODO(antoyo)
-    type DILocation = Location<'gcc>; // TODO(antoyo)
+    type DILocation = Location<'gcc>;
     type DIVariable = (); // TODO(antoyo)
 }
 
diff --git a/src/debuginfo.rs b/src/debuginfo.rs
index 0ac5841df63..51c5de2920b 100644
--- a/src/debuginfo.rs
+++ b/src/debuginfo.rs
@@ -31,7 +31,7 @@ impl<'a, 'gcc, 'tcx> DebugInfoBuilderMethods for Builder<'a, 'gcc, 'tcx> {
         _indirect_offsets: &[Size],
         _fragment: Option<Range<Size>>,
     ) {
-        // Not sure if this is correct, probably wrong but still keep it here.
+        // FIXME(tempdragon): Not sure if this is correct, probably wrong but still keep it here.
         #[cfg(feature = "master")]
         variable_alloca.set_location(dbg_loc);
     }
@@ -40,11 +40,10 @@ impl<'a, 'gcc, 'tcx> DebugInfoBuilderMethods for Builder<'a, 'gcc, 'tcx> {
         // TODO(antoyo): insert reference to gdb debug scripts section global.
     }
 
-    /// Currently, this function is not yet implemented. It seems that the
+    /// FIXME(tempdragon): Currently, this function is not yet implemented. It seems that the
     /// debug name and the mangled name should both be included in the LValues.
     /// Besides, a function to get the rvalue type(m_is_lvalue) should also be included.
     fn set_var_name(&mut self, _value: RValue<'gcc>, _name: &str) {
-        //unimplemented!();
     }
 
     fn set_dbg_loc(&mut self, dbg_loc: Self::DILocation) {
@@ -213,7 +212,7 @@ impl<'gcc, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
         _scope_metadata: Self::DIScope,
         _file: &SourceFile,
     ) -> Self::DIScope {
-        //unimplemented!();
+        // TODO(antoyo): implement.
     }
 
     fn debuginfo_finalize(&self) {
@@ -238,7 +237,7 @@ impl<'gcc, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
         _fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
         _maybe_definition_llfn: Option<RValue<'gcc>>,
     ) -> Self::DIScope {
-        //unimplemented!();
+        // TODO(antoyo): implement.
     }
 
     fn dbg_loc(
@@ -247,7 +246,6 @@ impl<'gcc, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
         _inlined_at: Option<Self::DILocation>,
         span: Span,
     ) -> Self::DILocation {
-        //unimplemented!();
         let pos = span.lo();
         let (file, line, col) = self.lookup_debug_loc(pos);
         let loc = match &file.name {
@@ -256,7 +254,7 @@ impl<'gcc, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
                     if let Some(name) = name.to_str() {
                         self.context
                             .new_location(name, line as i32, col as i32)
-                    }else{
+                    } else{
                         Location::null()
                     }
                 }
@@ -273,7 +271,7 @@ impl<'gcc, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
                     } else {
                         Location::null()
                     }
-                }else{
+                } else{
                     Location::null()
                 },
             },
diff --git a/src/lib.rs b/src/lib.rs
index cdb7cbebc1c..1c1f82c3221 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -175,7 +175,7 @@ impl CodegenBackend for GccCodegenBackend {
         crate::DEFAULT_LOCALE_RESOURCE
     }
 
-    fn init(&self, sess: &Session) {        
+    fn init(&self, sess: &Session) {
         #[cfg(feature="master")]
         {
             let target_cpu = target_cpu(sess);