[llvm] [BOLT] Add getter for optional relocations (PR #133085)
    via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Mar 26 06:52:13 PDT 2025
    
    
  
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-bolt
Author: Paschalis Mpeis (paschalis-mpeis)
<details>
<summary>Changes</summary>
Minor refactoring on comments.
---
Full diff: https://github.com/llvm/llvm-project/pull/133085.diff
1 Files Affected:
- (modified) bolt/include/bolt/Core/Relocation.h (+4-3) 
``````````diff
diff --git a/bolt/include/bolt/Core/Relocation.h b/bolt/include/bolt/Core/Relocation.h
index 9292d0496d658..78e94cd63829d 100644
--- a/bolt/include/bolt/Core/Relocation.h
+++ b/bolt/include/bolt/Core/Relocation.h
@@ -57,7 +57,8 @@ class Relocation {
   uint32_t Type;
 
 private:
-  /// Relocations added by optimizations can be optional.
+  /// Relocations added by optimizations can be optional, meaning they can be
+  /// omitted under certain circumstances.
   bool Optional = false;
 
 public:
@@ -72,10 +73,10 @@ class Relocation {
   /// Return size in bytes of the given relocation \p Type.
   static size_t getSizeForType(uint32_t Type);
 
-  /// Some relocations added by optimizations are optional, meaning they can be
-  /// omitted under certain circumstances.
   void setOptional() { Optional = true; }
 
+  bool isOptional() { return Optional; }
+
   /// Return size of this relocation.
   size_t getSize() const { return getSizeForType(Type); }
 
``````````
</details>
https://github.com/llvm/llvm-project/pull/133085
    
    
More information about the llvm-commits
mailing list