[ADT] Fix a confusing interface spec and some annoying peculiarities
[oota-llvm.git] / include / llvm / MC / MCLinkerOptimizationHint.h
index 8c0813b6b0a6af52310281c1837ecb22c1c2ad39..a519c4b71b033163b8d4ff500d1e177d0164e844 100644 (file)
@@ -103,10 +103,10 @@ class MCLOHDirective {
   /// Arguments of this directive. Order matters.
   SmallVector<MCSymbol *, 3> Args;
 
-  /// Emit this directive in @p OutStream using the information available
-  /// in the given @p ObjWriter and @p Layout to get the address of the
+  /// Emit this directive in \p OutStream using the information available
+  /// in the given \p ObjWriter and \p Layout to get the address of the
   /// arguments within the object file.
-  void Emit_impl(raw_ostream &OutStream, const MachObjectWriter &ObjWriter,
+  void emit_impl(raw_ostream &OutStream, const MachObjectWriter &ObjWriter,
                  const MCAsmLayout &Layout) const;
 
 public:
@@ -123,13 +123,13 @@ public:
 
   /// Emit this directive as:
   /// <kind, numArgs, addr1, ..., addrN>
-  void Emit(MachObjectWriter &ObjWriter, const MCAsmLayout &Layout) const {
+  void emit(MachObjectWriter &ObjWriter, const MCAsmLayout &Layout) const {
     raw_ostream &OutStream = ObjWriter.getStream();
-    Emit_impl(OutStream, ObjWriter, Layout);
+    emit_impl(OutStream, ObjWriter, Layout);
   }
 
-  /// Get the size in bytes of this directive if emitted in @p ObjWriter with
-  /// the given @p Layout.
+  /// Get the size in bytes of this directive if emitted in \p ObjWriter with
+  /// the given \p Layout.
   uint64_t getEmitSize(const MachObjectWriter &ObjWriter,
                        const MCAsmLayout &Layout) const {
     class raw_counting_ostream : public raw_ostream {
@@ -140,16 +140,12 @@ public:
       uint64_t current_pos() const override { return Count; }
 
     public:
-      raw_counting_ostream() : raw_ostream(SK_COUNTING), Count(0) {}
-      ~raw_counting_ostream() { flush(); }
-
-      static bool classof(const raw_ostream *OS) {
-        return OS->getKind() == SK_COUNTING;
-      }
+      raw_counting_ostream() : Count(0) {}
+      ~raw_counting_ostream() override { flush(); }
     };
 
     raw_counting_ostream OutStream;
-    Emit_impl(OutStream, ObjWriter, Layout);
+    emit_impl(OutStream, ObjWriter, Layout);
     return OutStream.tell();
   }
 };
@@ -164,15 +160,15 @@ class MCLOHContainer {
 public:
   typedef SmallVectorImpl<MCLOHDirective> LOHDirectives;
 
-  MCLOHContainer() : EmitSize(0) {};
+  MCLOHContainer() : EmitSize(0) {}
 
   /// Const accessor to the directives.
   const LOHDirectives &getDirectives() const {
     return Directives;
   }
 
-  /// Add the directive of the given kind @p Kind with the given arguments
-  /// @p Args to the container.
+  /// Add the directive of the given kind \p Kind with the given arguments
+  /// \p Args to the container.
   void addDirective(MCLOHType Kind, const MCLOHDirective::LOHArgs &Args) {
     Directives.push_back(MCLOHDirective(Kind, Args));
   }
@@ -188,10 +184,10 @@ public:
   }
 
   /// Emit all Linker Optimization Hint in one big table.
-  /// Each line of the table is emitted by LOHDirective::Emit.
-  void Emit(MachObjectWriter &ObjWriter, const MCAsmLayout &Layout) const {
+  /// Each line of the table is emitted by LOHDirective::emit.
+  void emit(MachObjectWriter &ObjWriter, const MCAsmLayout &Layout) const {
     for (const MCLOHDirective &D : Directives)
-      D.Emit(ObjWriter, Layout);
+      D.emit(ObjWriter, Layout);
   }
 
   void reset() {