[llvm] r249287 - Reformat 3 files in llvm/include/llvm/CodeGen/.
NAKAMURA Takumi via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 4 21:44:18 PDT 2015
Author: chapuni
Date: Sun Oct 4 23:44:18 2015
New Revision: 249287
URL: http://llvm.org/viewvc/llvm-project?rev=249287&view=rev
Log:
Reformat 3 files in llvm/include/llvm/CodeGen/.
Modified:
llvm/trunk/include/llvm/CodeGen/IntrinsicLowering.h
llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h
llvm/trunk/include/llvm/CodeGen/MachineModuleInfoImpls.h
Modified: llvm/trunk/include/llvm/CodeGen/IntrinsicLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/IntrinsicLowering.h?rev=249287&r1=249286&r2=249287&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/IntrinsicLowering.h (original)
+++ llvm/trunk/include/llvm/CodeGen/IntrinsicLowering.h Sun Oct 4 23:44:18 2015
@@ -19,41 +19,40 @@
#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
Modified: llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h?rev=249287&r1=249286&r2=249287&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h Sun Oct 4 23:44:18 2015
@@ -25,76 +25,74 @@
namespace llvm {
- class LiveStacks : public MachineFunctionPass {
- const TargetRegisterInfo *TRI;
+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;
- };
+ /// 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 */
Modified: llvm/trunk/include/llvm/CodeGen/MachineModuleInfoImpls.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineModuleInfoImpls.h?rev=249287&r1=249286&r2=249287&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineModuleInfoImpls.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineModuleInfoImpls.h Sun Oct 4 23:44:18 2015
@@ -18,79 +18,71 @@
#include "llvm/CodeGen/MachineModuleInfo.h"
namespace llvm {
- class MCSymbol;
+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);
- }
- };
+/// 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
More information about the llvm-commits
mailing list