Reformat 3 files in llvm/include/llvm/CodeGen/.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 5 Oct 2015 04:44:18 +0000 (04:44 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 5 Oct 2015 04:44:18 +0000 (04:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249287 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/IntrinsicLowering.h
include/llvm/CodeGen/LiveStackAnalysis.h
include/llvm/CodeGen/MachineModuleInfoImpls.h

index 9e6ab7d45977e960b4dae4231106e92e32a93d33..a404b9b70d3ac2e6252548572a95ac2371d87a53 100644 (file)
 #include "llvm/IR/Intrinsics.h"
 
 namespace llvm {
-  class CallInst;
-  class Module;
-  class DataLayout;
-
-  class IntrinsicLowering {
-    const DataLayout& DL;
-
-    
-    bool Warned;
-  public:
-    explicit IntrinsicLowering(const DataLayout &DL) :
-      DL(DL), Warned(false) {}
-
-    /// AddPrototypes - This method, if called, causes all of the prototypes
-    /// that might be needed by an intrinsic lowering implementation to be
-    /// inserted into the module specified.
-    void AddPrototypes(Module &M);
-
-    /// LowerIntrinsicCall - This method replaces a call with the LLVM function
-    /// which should be used to implement the specified intrinsic function call.
-    /// If an intrinsic function must be implemented by the code generator 
-    /// (such as va_start), this function should print a message and abort.
-    ///
-    /// Otherwise, if an intrinsic function call can be lowered, the code to
-    /// implement it (often a call to a non-intrinsic function) is inserted
-    /// _after_ the call instruction and the call is deleted.  The caller must
-    /// be capable of handling this kind of change.
-    ///
-    void LowerIntrinsicCall(CallInst *CI);
-
-    /// LowerToByteSwap - Replace a call instruction into a call to bswap
-    /// intrinsic. Return false if it has determined the call is not a
-    /// simple integer bswap.
-    static bool LowerToByteSwap(CallInst *CI);
-  };
+class CallInst;
+class Module;
+class DataLayout;
+
+class IntrinsicLowering {
+  const DataLayout &DL;
+
+  bool Warned;
+
+public:
+  explicit IntrinsicLowering(const DataLayout &DL) : DL(DL), Warned(false) {}
+
+  /// AddPrototypes - This method, if called, causes all of the prototypes
+  /// that might be needed by an intrinsic lowering implementation to be
+  /// inserted into the module specified.
+  void AddPrototypes(Module &M);
+
+  /// LowerIntrinsicCall - This method replaces a call with the LLVM function
+  /// which should be used to implement the specified intrinsic function call.
+  /// If an intrinsic function must be implemented by the code generator
+  /// (such as va_start), this function should print a message and abort.
+  ///
+  /// Otherwise, if an intrinsic function call can be lowered, the code to
+  /// implement it (often a call to a non-intrinsic function) is inserted
+  /// _after_ the call instruction and the call is deleted.  The caller must
+  /// be capable of handling this kind of change.
+  ///
+  void LowerIntrinsicCall(CallInst *CI);
+
+  /// LowerToByteSwap - Replace a call instruction into a call to bswap
+  /// intrinsic. Return false if it has determined the call is not a
+  /// simple integer bswap.
+  static bool LowerToByteSwap(CallInst *CI);
+};
 }
 
 #endif
index f495507c66ecd2595aaff147f579faea95f21420..3ffbe3d775b42ebbb6828d3383c64fcf1c101d91 100644 (file)
 
 namespace llvm {
 
-  class LiveStacks : public MachineFunctionPass {
-    const TargetRegisterInfo *TRI;
-
-    /// Special pool allocator for VNInfo's (LiveInterval val#).
-    ///
-    VNInfo::Allocator VNInfoAllocator;
-
-    /// S2IMap - Stack slot indices to live interval mapping.
-    ///
-    typedef std::unordered_map<int, LiveInterval> SS2IntervalMap;
-    SS2IntervalMap S2IMap;
-
-    /// S2RCMap - Stack slot indices to register class mapping.
-    std::map<int, const TargetRegisterClass*> S2RCMap;
-    
-  public:
-    static char ID; // Pass identification, replacement for typeid
-    LiveStacks() : MachineFunctionPass(ID) {
-      initializeLiveStacksPass(*PassRegistry::getPassRegistry());
-    }
-
-    typedef SS2IntervalMap::iterator iterator;
-    typedef SS2IntervalMap::const_iterator const_iterator;
-    const_iterator begin() const { return S2IMap.begin(); }
-    const_iterator end() const { return S2IMap.end(); }
-    iterator begin() { return S2IMap.begin(); }
-    iterator end() { return S2IMap.end(); }
-
-    unsigned getNumIntervals() const { return (unsigned)S2IMap.size(); }
-
-    LiveInterval &getOrCreateInterval(int Slot, const TargetRegisterClass *RC);
-
-    LiveInterval &getInterval(int Slot) {
-      assert(Slot >= 0 && "Spill slot indice must be >= 0");
-      SS2IntervalMap::iterator I = S2IMap.find(Slot);
-      assert(I != S2IMap.end() && "Interval does not exist for stack slot");
-      return I->second;
-    }
-
-    const LiveInterval &getInterval(int Slot) const {
-      assert(Slot >= 0 && "Spill slot indice must be >= 0");
-      SS2IntervalMap::const_iterator I = S2IMap.find(Slot);
-      assert(I != S2IMap.end() && "Interval does not exist for stack slot");
-      return I->second;
-    }
-
-    bool hasInterval(int Slot) const {
-      return S2IMap.count(Slot);
-    }
-
-    const TargetRegisterClass *getIntervalRegClass(int Slot) const {
-      assert(Slot >= 0 && "Spill slot indice must be >= 0");
-      std::map<int, const TargetRegisterClass*>::const_iterator
-        I = S2RCMap.find(Slot);
-      assert(I != S2RCMap.end() &&
-             "Register class info does not exist for stack slot");
-      return I->second;
-    }
-
-    VNInfo::Allocator& getVNInfoAllocator() { return VNInfoAllocator; }
-
-    void getAnalysisUsage(AnalysisUsage &AU) const override;
-    void releaseMemory() override;
-
-    /// runOnMachineFunction - pass entry point
-    bool runOnMachineFunction(MachineFunction&) override;
-
-    /// print - Implement the dump method.
-    void print(raw_ostream &O, const Module* = nullptr) const override;
-  };
+class LiveStacks : public MachineFunctionPass {
+  const TargetRegisterInfo *TRI;
+
+  /// Special pool allocator for VNInfo's (LiveInterval val#).
+  ///
+  VNInfo::Allocator VNInfoAllocator;
+
+  /// S2IMap - Stack slot indices to live interval mapping.
+  ///
+  typedef std::unordered_map<int, LiveInterval> SS2IntervalMap;
+  SS2IntervalMap S2IMap;
+
+  /// S2RCMap - Stack slot indices to register class mapping.
+  std::map<int, const TargetRegisterClass *> S2RCMap;
+
+public:
+  static char ID; // Pass identification, replacement for typeid
+  LiveStacks() : MachineFunctionPass(ID) {
+    initializeLiveStacksPass(*PassRegistry::getPassRegistry());
+  }
+
+  typedef SS2IntervalMap::iterator iterator;
+  typedef SS2IntervalMap::const_iterator const_iterator;
+  const_iterator begin() const { return S2IMap.begin(); }
+  const_iterator end() const { return S2IMap.end(); }
+  iterator begin() { return S2IMap.begin(); }
+  iterator end() { return S2IMap.end(); }
+
+  unsigned getNumIntervals() const { return (unsigned)S2IMap.size(); }
+
+  LiveInterval &getOrCreateInterval(int Slot, const TargetRegisterClass *RC);
+
+  LiveInterval &getInterval(int Slot) {
+    assert(Slot >= 0 && "Spill slot indice must be >= 0");
+    SS2IntervalMap::iterator I = S2IMap.find(Slot);
+    assert(I != S2IMap.end() && "Interval does not exist for stack slot");
+    return I->second;
+  }
+
+  const LiveInterval &getInterval(int Slot) const {
+    assert(Slot >= 0 && "Spill slot indice must be >= 0");
+    SS2IntervalMap::const_iterator I = S2IMap.find(Slot);
+    assert(I != S2IMap.end() && "Interval does not exist for stack slot");
+    return I->second;
+  }
+
+  bool hasInterval(int Slot) const { return S2IMap.count(Slot); }
+
+  const TargetRegisterClass *getIntervalRegClass(int Slot) const {
+    assert(Slot >= 0 && "Spill slot indice must be >= 0");
+    std::map<int, const TargetRegisterClass *>::const_iterator I =
+        S2RCMap.find(Slot);
+    assert(I != S2RCMap.end() &&
+           "Register class info does not exist for stack slot");
+    return I->second;
+  }
+
+  VNInfo::Allocator &getVNInfoAllocator() { return VNInfoAllocator; }
+
+  void getAnalysisUsage(AnalysisUsage &AU) const override;
+  void releaseMemory() override;
+
+  /// runOnMachineFunction - pass entry point
+  bool runOnMachineFunction(MachineFunction &) override;
+
+  /// print - Implement the dump method.
+  void print(raw_ostream &O, const Module * = nullptr) const override;
+};
 }
 
 #endif /* LLVM_CODEGEN_LIVESTACK_ANALYSIS_H */
index a67f9b5666b17d263ff001785447521be1ae6559..e7472145e71f57811c2331df41ce2454725fa017 100644 (file)
 #include "llvm/CodeGen/MachineModuleInfo.h"
 
 namespace llvm {
-  class MCSymbol;
-
-  /// MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation
-  /// for MachO targets.
-  class MachineModuleInfoMachO : public MachineModuleInfoImpl {
-    /// FnStubs - Darwin '$stub' stubs.  The key is something like "Lfoo$stub",
-    /// the value is something like "_foo".
-    DenseMap<MCSymbol*, StubValueTy> FnStubs;
-    
-    /// GVStubs - Darwin '$non_lazy_ptr' stubs.  The key is something like
-    /// "Lfoo$non_lazy_ptr", the value is something like "_foo". The extra bit
-    /// is true if this GV is external.
-    DenseMap<MCSymbol*, StubValueTy> GVStubs;
-    
-    /// HiddenGVStubs - Darwin '$non_lazy_ptr' stubs.  The key is something like
-    /// "Lfoo$non_lazy_ptr", the value is something like "_foo".  Unlike GVStubs
-    /// these are for things with hidden visibility. The extra bit is true if
-    /// this GV is external.
-    DenseMap<MCSymbol*, StubValueTy> HiddenGVStubs;
-    
-    virtual void anchor();  // Out of line virtual method.
-  public:
-    MachineModuleInfoMachO(const MachineModuleInfo &) {}
-    
-    StubValueTy &getFnStubEntry(MCSymbol *Sym) {
-      assert(Sym && "Key cannot be null");
-      return FnStubs[Sym];
-    }
-
-    StubValueTy &getGVStubEntry(MCSymbol *Sym) {
-      assert(Sym && "Key cannot be null");
-      return GVStubs[Sym];
-    }
-
-    StubValueTy &getHiddenGVStubEntry(MCSymbol *Sym) {
-      assert(Sym && "Key cannot be null");
-      return HiddenGVStubs[Sym];
-    }
-
-    /// Accessor methods to return the set of stubs in sorted order.
-    SymbolListTy GetFnStubList() {
-      return getSortedStubs(FnStubs);
-    }
-    SymbolListTy GetGVStubList() {
-      return getSortedStubs(GVStubs);
-    }
-    SymbolListTy GetHiddenGVStubList() {
-      return getSortedStubs(HiddenGVStubs);
-    }
-  };
-
-  /// MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation
-  /// for ELF targets.
-  class MachineModuleInfoELF : public MachineModuleInfoImpl {
-    /// GVStubs - These stubs are used to materialize global addresses in PIC
-    /// mode.
-    DenseMap<MCSymbol*, StubValueTy> GVStubs;
-
-    virtual void anchor();  // Out of line virtual method.
-  public:
-    MachineModuleInfoELF(const MachineModuleInfo &) {}
-
-    StubValueTy &getGVStubEntry(MCSymbol *Sym) {
-      assert(Sym && "Key cannot be null");
-      return GVStubs[Sym];
-    }
-
-    /// Accessor methods to return the set of stubs in sorted order.
-
-    SymbolListTy GetGVStubList() {
-      return getSortedStubs(GVStubs);
-    }
-  };
+class MCSymbol;
+
+/// MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation
+/// for MachO targets.
+class MachineModuleInfoMachO : public MachineModuleInfoImpl {
+  /// FnStubs - Darwin '$stub' stubs.  The key is something like "Lfoo$stub",
+  /// the value is something like "_foo".
+  DenseMap<MCSymbol *, StubValueTy> FnStubs;
+
+  /// GVStubs - Darwin '$non_lazy_ptr' stubs.  The key is something like
+  /// "Lfoo$non_lazy_ptr", the value is something like "_foo". The extra bit
+  /// is true if this GV is external.
+  DenseMap<MCSymbol *, StubValueTy> GVStubs;
+
+  /// HiddenGVStubs - Darwin '$non_lazy_ptr' stubs.  The key is something like
+  /// "Lfoo$non_lazy_ptr", the value is something like "_foo".  Unlike GVStubs
+  /// these are for things with hidden visibility. The extra bit is true if
+  /// this GV is external.
+  DenseMap<MCSymbol *, StubValueTy> HiddenGVStubs;
+
+  virtual void anchor(); // Out of line virtual method.
+public:
+  MachineModuleInfoMachO(const MachineModuleInfo &) {}
+
+  StubValueTy &getFnStubEntry(MCSymbol *Sym) {
+    assert(Sym && "Key cannot be null");
+    return FnStubs[Sym];
+  }
+
+  StubValueTy &getGVStubEntry(MCSymbol *Sym) {
+    assert(Sym && "Key cannot be null");
+    return GVStubs[Sym];
+  }
+
+  StubValueTy &getHiddenGVStubEntry(MCSymbol *Sym) {
+    assert(Sym && "Key cannot be null");
+    return HiddenGVStubs[Sym];
+  }
+
+  /// Accessor methods to return the set of stubs in sorted order.
+  SymbolListTy GetFnStubList() { return getSortedStubs(FnStubs); }
+  SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
+  SymbolListTy GetHiddenGVStubList() { return getSortedStubs(HiddenGVStubs); }
+};
+
+/// MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation
+/// for ELF targets.
+class MachineModuleInfoELF : public MachineModuleInfoImpl {
+  /// GVStubs - These stubs are used to materialize global addresses in PIC
+  /// mode.
+  DenseMap<MCSymbol *, StubValueTy> GVStubs;
+
+  virtual void anchor(); // Out of line virtual method.
+public:
+  MachineModuleInfoELF(const MachineModuleInfo &) {}
+
+  StubValueTy &getGVStubEntry(MCSymbol *Sym) {
+    assert(Sym && "Key cannot be null");
+    return GVStubs[Sym];
+  }
+
+  /// Accessor methods to return the set of stubs in sorted order.
+
+  SymbolListTy GetGVStubList() { return getSortedStubs(GVStubs); }
+};
 
 } // end namespace llvm