From 31c488c8bdef56618e45a5356a7c6770d13e1241 Mon Sep 17 00:00:00 2001 From: Che-Liang Chiou Date: Wed, 2 Mar 2011 07:58:46 +0000 Subject: [PATCH] ptx: fix lint and compiler warnings git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126838 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PTX/PTXAsmPrinter.cpp | 6 ++++-- lib/Target/PTX/PTXTargetMachine.cpp | 14 ++++++++------ lib/Target/PTX/PTXTargetMachine.h | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/Target/PTX/PTXAsmPrinter.cpp b/lib/Target/PTX/PTXAsmPrinter.cpp index 2249d868305..13134032cb7 100644 --- a/lib/Target/PTX/PTXAsmPrinter.cpp +++ b/lib/Target/PTX/PTXAsmPrinter.cpp @@ -361,7 +361,8 @@ void PTXAsmPrinter::EmitFunctionDeclaration() { unsigned cnt = 0; //for (int i = 0, e = MFI->getNumArg(); i != e; ++i) { for(PTXMachineFunctionInfo::reg_reverse_iterator - i = MFI->argRegReverseBegin(), e = MFI->argRegReverseEnd(), b = i; i != e; ++i) { + i = MFI->argRegReverseBegin(), e = MFI->argRegReverseEnd(), b = i; + i != e; ++i) { reg = *i; assert(reg != PTX::NoRegister && "Not a valid register!"); if (i != b) @@ -374,7 +375,8 @@ void PTXAsmPrinter::EmitFunctionDeclaration() { } } else { for (PTXMachineFunctionInfo::reg_reverse_iterator - i = MFI->argRegReverseBegin(), e = MFI->argRegReverseEnd(), b = i; i != e; ++i) { + i = MFI->argRegReverseBegin(), e = MFI->argRegReverseEnd(), b = i; + i != e; ++i) { reg = *i; assert(reg != PTX::NoRegister && "Not a valid register!"); if (i != b) diff --git a/lib/Target/PTX/PTXTargetMachine.cpp b/lib/Target/PTX/PTXTargetMachine.cpp index 371510fe325..4701a941d18 100644 --- a/lib/Target/PTX/PTXTargetMachine.cpp +++ b/lib/Target/PTX/PTXTargetMachine.cpp @@ -36,23 +36,25 @@ extern "C" void LLVMInitializePTXTarget() { } namespace { - const char* DataLayout32 = "e-p:32:32-i64:32:32-f64:32:32-v128:32:128-v64:32:64-n32:64"; - const char* DataLayout64 = "e-p:64:64-i64:32:32-f64:32:32-v128:32:128-v64:32:64-n32:64"; + const char* DataLayout32 = + "e-p:32:32-i64:32:32-f64:32:32-v128:32:128-v64:32:64-n32:64"; + const char* DataLayout64 = + "e-p:64:64-i64:32:32-f64:32:32-v128:32:128-v64:32:64-n32:64"; } // DataLayout and FrameLowering are filled with dummy data PTXTargetMachine::PTXTargetMachine(const Target &T, const std::string &TT, const std::string &FS) - : Subtarget(TT, FS), + : LLVMTargetMachine(T, TT), // FIXME: This feels like a dirty hack, but Subtarget does not appear to be // initialized at this point, and we need to finish initialization of // DataLayout. DataLayout((FS.find("64bit") != FS.npos) ? DataLayout64 : DataLayout32), - LLVMTargetMachine(T, TT), + Subtarget(TT, FS), FrameLowering(Subtarget), - TLInfo(*this), - InstrInfo(*this) { + InstrInfo(*this), + TLInfo(*this) { } bool PTXTargetMachine::addInstSelector(PassManagerBase &PM, diff --git a/lib/Target/PTX/PTXTargetMachine.h b/lib/Target/PTX/PTXTargetMachine.h index 2add7134bae..a5dba537d1d 100644 --- a/lib/Target/PTX/PTXTargetMachine.h +++ b/lib/Target/PTX/PTXTargetMachine.h @@ -26,10 +26,10 @@ namespace llvm { class PTXTargetMachine : public LLVMTargetMachine { private: const TargetData DataLayout; + PTXSubtarget Subtarget; // has to be initialized before FrameLowering PTXFrameLowering FrameLowering; PTXInstrInfo InstrInfo; PTXTargetLowering TLInfo; - PTXSubtarget Subtarget; public: PTXTargetMachine(const Target &T, const std::string &TT, -- 2.34.1