diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2012-03-23 22:31:55 -0400 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2012-03-23 22:31:55 -0400 |
commit | d86e267d07852e312fa3e4b6b0faa8ef2320e89d (patch) | |
tree | deefd65eeee8975a76fb22549c334d03b6599b4d | |
parent | a9ec18c75d489a4854cf8df90b192a91b92a259d (diff) |
Remvoe OSTREAM_TYPE macro
-rw-r--r-- | lib/Target/AMDIL/AMDIL7XXAsmPrinter.cpp | 2 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDIL7XXAsmPrinter.h | 2 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILAsmPrinter.cpp | 8 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILAsmPrinter.h | 10 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILEGAsmPrinter.cpp | 2 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILEGAsmPrinter.h | 2 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILGlobalManager.cpp | 26 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILGlobalManager.h | 6 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILKernelManager.cpp | 36 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILKernelManager.h | 24 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILLLVMVersion.h | 3 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILModuleInfo.cpp | 26 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILModuleInfo.h | 4 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILTargetMachine.cpp | 2 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILTargetMachine.h | 2 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILUtilityFunctions.cpp | 2 | ||||
-rw-r--r-- | lib/Target/AMDIL/AMDILUtilityFunctions.h | 2 |
17 files changed, 78 insertions, 81 deletions
diff --git a/lib/Target/AMDIL/AMDIL7XXAsmPrinter.cpp b/lib/Target/AMDIL/AMDIL7XXAsmPrinter.cpp index c40df2f73e1..72588a97c31 100644 --- a/lib/Target/AMDIL/AMDIL7XXAsmPrinter.cpp +++ b/lib/Target/AMDIL/AMDIL7XXAsmPrinter.cpp @@ -108,7 +108,7 @@ std::string Strip(const std::string &name) } void AMDIL7XXAsmPrinter::emitMacroFunc(const MachineInstr *MI, - OSTREAM_TYPE &O) + llvm::raw_ostream &O) { const AMDILSubtarget *curTarget = mTM->getSubtargetImpl(); const char *name = "unknown"; diff --git a/lib/Target/AMDIL/AMDIL7XXAsmPrinter.h b/lib/Target/AMDIL/AMDIL7XXAsmPrinter.h index 99632e744c4..f74a59cfe23 100644 --- a/lib/Target/AMDIL/AMDIL7XXAsmPrinter.h +++ b/lib/Target/AMDIL/AMDIL7XXAsmPrinter.h @@ -95,7 +95,7 @@ namespace llvm // registers as the macro arguments. // virtual void - emitMacroFunc(const MachineInstr *MI, OSTREAM_TYPE &O); + emitMacroFunc(const MachineInstr *MI, llvm::raw_ostream &O); }; // AMDIL7XXAsmPrinter } // end of llvm namespace diff --git a/lib/Target/AMDIL/AMDILAsmPrinter.cpp b/lib/Target/AMDIL/AMDILAsmPrinter.cpp index 9e82d73a4d8..23462b5bf67 100644 --- a/lib/Target/AMDIL/AMDILAsmPrinter.cpp +++ b/lib/Target/AMDIL/AMDILAsmPrinter.cpp @@ -187,7 +187,7 @@ AMDILAsmPrinter::EmitInstruction(const MachineInstr *II) } void AMDILAsmPrinter::emitMacroFunc(const MachineInstr *MI, - OSTREAM_TYPE &O) + llvm::raw_ostream &O) { const char *name = "unknown"; llvm::StringRef nameRef; @@ -290,7 +290,7 @@ AMDILAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) void AMDILAsmPrinter::printOperand(const MachineInstr *MI, int opNum, - OSTREAM_TYPE &O) + llvm::raw_ostream &O) { const MachineOperand &MO = MI->getOperand (opNum); @@ -443,7 +443,7 @@ void AMDILAsmPrinter::printMemOperand( const MachineInstr *MI, int opNum, - OSTREAM_TYPE &O, + llvm::raw_ostream &O, const char *Modifier ) { @@ -810,7 +810,7 @@ AMDILAsmPrinter::isMacroFunc(const MachineInstr *MI) { return amd::MacroDBFindMacro(nameRef.data()) != -1; } void -AMDILAsmPrinter::emitMCallInst(const MachineInstr *MI, OSTREAM_TYPE &O, const char *name) +AMDILAsmPrinter::emitMCallInst(const MachineInstr *MI, llvm::raw_ostream &O, const char *name) { const AMDILSubtarget *curTarget = mTM->getSubtargetImpl(); int macronum = amd::MacroDBFindMacro(name); diff --git a/lib/Target/AMDIL/AMDILAsmPrinter.h b/lib/Target/AMDIL/AMDILAsmPrinter.h index e83093e226c..c0e26e7ef20 100644 --- a/lib/Target/AMDIL/AMDILAsmPrinter.h +++ b/lib/Target/AMDIL/AMDILAsmPrinter.h @@ -108,7 +108,7 @@ namespace llvm // and add swizzle information in the cases that require it // virtual void - printOperand(const MachineInstr *MI, int opNum, OSTREAM_TYPE &O); + printOperand(const MachineInstr *MI, int opNum, llvm::raw_ostream &O); void EmitGlobalVariable(const GlobalVariable *GV); @@ -148,7 +148,7 @@ namespace llvm // @brief Print the memory operand based on the register type // void - printMemOperand(const MachineInstr *MI, int opNum, OSTREAM_TYPE &O, + printMemOperand(const MachineInstr *MI, int opNum, llvm::raw_ostream &O, const char *Modifier = NULL); // @@ -157,7 +157,7 @@ namespace llvm // the assembly format of the specified instruction // void - printInstruction(const MachineInstr *MI , OSTREAM_TYPE &O); // autogenerated + printInstruction(const MachineInstr *MI , llvm::raw_ostream &O); // autogenerated const char *getRegisterName(unsigned RegNo); @@ -211,7 +211,7 @@ namespace llvm // registers as the macro arguments. // virtual void - emitMacroFunc(const MachineInstr *MI , OSTREAM_TYPE &O); + emitMacroFunc(const MachineInstr *MI , llvm::raw_ostream &O); // Flag whether to print out debug information // or not. @@ -220,7 +220,7 @@ namespace llvm // // void - emitMCallInst(const MachineInstr *MI, OSTREAM_TYPE &O, const char *name); + emitMCallInst(const MachineInstr *MI, llvm::raw_ostream &O, const char *name); // Set of alll macros that are used in this compilation unit. llvm::DenseSet<uint32_t> mMacroIDs; diff --git a/lib/Target/AMDIL/AMDILEGAsmPrinter.cpp b/lib/Target/AMDIL/AMDILEGAsmPrinter.cpp index a07131c4139..5c845ea97a6 100644 --- a/lib/Target/AMDIL/AMDILEGAsmPrinter.cpp +++ b/lib/Target/AMDIL/AMDILEGAsmPrinter.cpp @@ -109,7 +109,7 @@ std::string Strip(const std::string &name) } void AMDILEGAsmPrinter::emitMacroFunc(const MachineInstr *MI, - OSTREAM_TYPE &O) + llvm::raw_ostream &O) { const AMDILSubtarget *curTarget = mTM->getSubtargetImpl(); const char *name = "unknown"; diff --git a/lib/Target/AMDIL/AMDILEGAsmPrinter.h b/lib/Target/AMDIL/AMDILEGAsmPrinter.h index 9956f03ddd4..f727373a866 100644 --- a/lib/Target/AMDIL/AMDILEGAsmPrinter.h +++ b/lib/Target/AMDIL/AMDILEGAsmPrinter.h @@ -94,7 +94,7 @@ namespace llvm // registers as the macro arguments. // virtual void - emitMacroFunc(const MachineInstr *MI, OSTREAM_TYPE &O); + emitMacroFunc(const MachineInstr *MI, llvm::raw_ostream &O); }; // AMDILEGAsmPrinter } // end of llvm namespace diff --git a/lib/Target/AMDIL/AMDILGlobalManager.cpp b/lib/Target/AMDIL/AMDILGlobalManager.cpp index a10f3f3f46a..3b30bc21301 100644 --- a/lib/Target/AMDIL/AMDILGlobalManager.cpp +++ b/lib/Target/AMDIL/AMDILGlobalManager.cpp @@ -1018,17 +1018,17 @@ const Value *AMDILGlobalManager::getConstPtrValue(const kernel &krnl, } static void -dumpZeroElements(const StructType * const T, OSTREAM_TYPE &O, bool asBytes); +dumpZeroElements(const StructType * const T, llvm::raw_ostream &O, bool asBytes); static void -dumpZeroElements(const IntegerType * const T, OSTREAM_TYPE &O, bool asBytes); +dumpZeroElements(const IntegerType * const T, llvm::raw_ostream &O, bool asBytes); static void -dumpZeroElements(const ArrayType * const T, OSTREAM_TYPE &O, bool asBytes); +dumpZeroElements(const ArrayType * const T, llvm::raw_ostream &O, bool asBytes); static void -dumpZeroElements(const VectorType * const T, OSTREAM_TYPE &O, bool asBytes); +dumpZeroElements(const VectorType * const T, llvm::raw_ostream &O, bool asBytes); static void -dumpZeroElements(const Type * const T, OSTREAM_TYPE &O, bool asBytes); +dumpZeroElements(const Type * const T, llvm::raw_ostream &O, bool asBytes); -void dumpZeroElements(const Type * const T, OSTREAM_TYPE &O, bool asBytes) { +void dumpZeroElements(const Type * const T, llvm::raw_ostream &O, bool asBytes) { if (!T) { return; } @@ -1082,7 +1082,7 @@ void dumpZeroElements(const Type * const T, OSTREAM_TYPE &O, bool asBytes) { } void -dumpZeroElements(const StructType * const ST, OSTREAM_TYPE &O, bool asBytes) { +dumpZeroElements(const StructType * const ST, llvm::raw_ostream &O, bool asBytes) { if (!ST) { return; } @@ -1096,7 +1096,7 @@ dumpZeroElements(const StructType * const ST, OSTREAM_TYPE &O, bool asBytes) { } void -dumpZeroElements(const IntegerType * const IT, OSTREAM_TYPE &O, bool asBytes) { +dumpZeroElements(const IntegerType * const IT, llvm::raw_ostream &O, bool asBytes) { if (asBytes) { unsigned byteWidth = (IT->getBitWidth() >> 3); for (unsigned x = 0; x < byteWidth; ++x) { @@ -1106,7 +1106,7 @@ dumpZeroElements(const IntegerType * const IT, OSTREAM_TYPE &O, bool asBytes) { } void -dumpZeroElements(const ArrayType * const AT, OSTREAM_TYPE &O, bool asBytes) { +dumpZeroElements(const ArrayType * const AT, llvm::raw_ostream &O, bool asBytes) { size_t size = AT->getNumElements(); for (size_t x = 0; x < size; ++x) { dumpZeroElements(AT->getElementType(), O, asBytes); @@ -1114,7 +1114,7 @@ dumpZeroElements(const ArrayType * const AT, OSTREAM_TYPE &O, bool asBytes) { } void -dumpZeroElements(const VectorType * const VT, OSTREAM_TYPE &O, bool asBytes) { +dumpZeroElements(const VectorType * const VT, llvm::raw_ostream &O, bool asBytes) { size_t size = VT->getNumElements(); for (size_t x = 0; x < size; ++x) { dumpZeroElements(VT->getElementType(), O, asBytes); @@ -1122,7 +1122,7 @@ dumpZeroElements(const VectorType * const VT, OSTREAM_TYPE &O, bool asBytes) { } void AMDILGlobalManager::printConstantValue(const Constant *CAval, - OSTREAM_TYPE &O, bool asBytes) { + llvm::raw_ostream &O, bool asBytes) { if (const ConstantFP *CFP = dyn_cast<ConstantFP>(CAval)) { bool isDouble = &CFP->getValueAPF().getSemantics()==&APFloat::IEEEdouble; if (isDouble) { @@ -1284,7 +1284,7 @@ static bool isStruct(Type * const T) } -void AMDILGlobalManager::dumpDataToCB(OSTREAM_TYPE &O, AMDILKernelManager *km, +void AMDILGlobalManager::dumpDataToCB(llvm::raw_ostream &O, AMDILKernelManager *km, uint32_t id) { uint32_t size = 0; for (StringMap<constPtr>::iterator cmb = consts_begin(), @@ -1351,7 +1351,7 @@ void AMDILGlobalManager::dumpDataToCB(OSTREAM_TYPE &O, AMDILKernelManager *km, } void -AMDILGlobalManager::dumpDataSection(OSTREAM_TYPE &O, AMDILKernelManager *km) { +AMDILGlobalManager::dumpDataSection(llvm::raw_ostream &O, AMDILKernelManager *km) { if (mConstMems.empty() && !mCurrentCPOffset) { return; } else { diff --git a/lib/Target/AMDIL/AMDILGlobalManager.h b/lib/Target/AMDIL/AMDILGlobalManager.h index b7fce97a0ec..f0b463dc335 100644 --- a/lib/Target/AMDIL/AMDILGlobalManager.h +++ b/lib/Target/AMDIL/AMDILGlobalManager.h @@ -210,7 +210,7 @@ public: /// Dump the data section to the output stream for the given kernel. - void dumpDataSection(OSTREAM_TYPE &O, AMDILKernelManager *km); + void dumpDataSection(llvm::raw_ostream &O, AMDILKernelManager *km); /// Iterate through the constants that are global to the compilation unit. StringMap<constPtr>::iterator consts_begin(); @@ -269,13 +269,13 @@ private: void parseImageAnnotate(const GlobalValue *G); void parseConstantPtrAnnotate(const GlobalValue *G); void printConstantValue(const Constant *CAval, - OSTREAM_TYPE& O, + llvm::raw_ostream& O, bool asByte); void parseKernelInformation(const Value *V); void parseAutoArray(const GlobalValue *G, bool isRegion); void parseConstantPtr(const GlobalValue *G); void allocateGlobalCB(); - void dumpDataToCB(OSTREAM_TYPE &O, AMDILKernelManager *km, uint32_t id); + void dumpDataToCB(llvm::raw_ostream &O, AMDILKernelManager *km, uint32_t id); bool checkConstPtrsUseHW(Module::const_iterator *F); llvm::StringMap<arraymem> mArrayMems; diff --git a/lib/Target/AMDIL/AMDILKernelManager.cpp b/lib/Target/AMDIL/AMDILKernelManager.cpp index 1fcc6042334..86a0fa65e89 100644 --- a/lib/Target/AMDIL/AMDILKernelManager.cpp +++ b/lib/Target/AMDIL/AMDILKernelManager.cpp @@ -76,7 +76,7 @@ using namespace llvm; #define NUM_EXTRA_SLOTS_PER_IMAGE 1 -static bool errorPrint(const char *ptr, OSTREAM_TYPE &O) { +static bool errorPrint(const char *ptr, llvm::raw_ostream &O) { if (ptr[0] == 'E') { O << ";error:" << ptr << "\n"; } else { @@ -87,7 +87,7 @@ static bool errorPrint(const char *ptr, OSTREAM_TYPE &O) { #if 0 static bool -samplerPrint(StringMap<SamplerInfo>::iterator &data, OSTREAM_TYPE &O) { +samplerPrint(StringMap<SamplerInfo>::iterator &data, llvm::raw_ostream &O) { O << ";sampler:" << (*data).second.name << ":" << (*data).second.idx << ":" << ((*data).second.val == (uint32_t)-1 ? 0 : 1) << ":" << ((*data).second.val != (uint32_t)-1 ? (*data).second.val : 0) @@ -96,27 +96,27 @@ samplerPrint(StringMap<SamplerInfo>::iterator &data, OSTREAM_TYPE &O) { } #endif -static bool arenaPrint(uint32_t val, OSTREAM_TYPE &O) { +static bool arenaPrint(uint32_t val, llvm::raw_ostream &O) { if (val >= ARENA_SEGMENT_RESERVED_UAVS) { O << "dcl_arena_uav_id(" << val << ")\n"; } return false; } -static bool uavPrint(uint32_t val, OSTREAM_TYPE &O) { +static bool uavPrint(uint32_t val, llvm::raw_ostream &O) { if (val < 8 || val == 11){ O << "dcl_raw_uav_id(" << val << ")\n"; } return false; } -static bool uavPrintSI(uint32_t val, OSTREAM_TYPE &O) { +static bool uavPrintSI(uint32_t val, llvm::raw_ostream &O) { O << "dcl_typeless_uav_id(" << val << ")_stride(4)_length(4)_access(read_write)\n"; return false; } static bool -printfPrint(std::pair<const std::string, PrintfInfo *> &data, OSTREAM_TYPE &O) { +printfPrint(std::pair<const std::string, PrintfInfo *> &data, llvm::raw_ostream &O) { O << ";printf_fmt:" << data.second->getPrintfID(); // Number of operands O << ":" << data.second->getNumOperands(); @@ -261,7 +261,7 @@ bool AMDILKernelManager::useCompilerWrite(const MachineInstr *MI) { && !mHasOutputInst); } -void AMDILKernelManager::processArgMetadata(OSTREAM_TYPE &O, +void AMDILKernelManager::processArgMetadata(llvm::raw_ostream &O, uint32_t buf, bool isKernel) { @@ -435,7 +435,7 @@ void AMDILKernelManager::processArgMetadata(OSTREAM_TYPE &O, } void AMDILKernelManager::printHeader(AMDILAsmPrinter *AsmPrinter, - OSTREAM_TYPE &O, + llvm::raw_ostream &O, const std::string &name) { mName = name; std::string kernelName; @@ -450,7 +450,7 @@ void AMDILKernelManager::printHeader(AMDILAsmPrinter *AsmPrinter, O << "mov " << AsmPrinter->getRegisterName(AMDIL::SP) << ", l1.0\n"; } -void AMDILKernelManager::printGroupSize(OSTREAM_TYPE& O) { +void AMDILKernelManager::printGroupSize(llvm::raw_ostream& O) { // The HD4XXX generation of hardware does not support a 3D launch, so we need // to use dcl_num_thread_per_group to specify the launch size. If the launch // size is specified via a kernel attribute, we print it here. Otherwise we @@ -533,7 +533,7 @@ void AMDILKernelManager::printGroupSize(OSTREAM_TYPE& O) { } void -AMDILKernelManager::printDecls(AMDILAsmPrinter *AsmPrinter, OSTREAM_TYPE &O) { +AMDILKernelManager::printDecls(AMDILAsmPrinter *AsmPrinter, llvm::raw_ostream &O) { // If we are a HD4XXX generation device, then we only support a single uav // surface, so we declare it and leave if (mSTM->device()->getGeneration() == AMDILDeviceInfo::HD4XXX) { @@ -598,7 +598,7 @@ AMDILKernelManager::printDecls(AMDILAsmPrinter *AsmPrinter, OSTREAM_TYPE &O) { } void AMDILKernelManager::getIntrinsicSetup(AMDILAsmPrinter *AsmPrinter, - OSTREAM_TYPE &O) + llvm::raw_ostream &O) { O << "mov r0.z, vThreadGrpIdFlat.x\n" << "mov r1022.xyz0, vTidInGrp.xyz\n"; @@ -683,13 +683,13 @@ void AMDILKernelManager::getIntrinsicSetup(AMDILAsmPrinter *AsmPrinter, } } -void AMDILKernelManager::printFooter(OSTREAM_TYPE &O) { +void AMDILKernelManager::printFooter(llvm::raw_ostream &O) { O << "ret\n"; O << "endfunc ; " << mName << "\n"; } void -AMDILKernelManager::printMetaData(OSTREAM_TYPE &O, uint32_t id, bool kernel) { +AMDILKernelManager::printMetaData(llvm::raw_ostream &O, uint32_t id, bool kernel) { if (kernel) { int kernelId = mGM->getOrCreateFunctionID(mName); mMFI->addCalledFunc(id); @@ -739,7 +739,7 @@ void AMDILKernelManager::setOutputInst() { void AMDILKernelManager::printConstantToRegMapping( AMDILAsmPrinter *RegNames, uint32_t &LII, - OSTREAM_TYPE &O, + llvm::raw_ostream &O, uint32_t &Counter, uint32_t Buffer, uint32_t n, @@ -803,7 +803,7 @@ void AMDILKernelManager::printConstantToRegMapping( void AMDILKernelManager::printCopyStructPrivate(const StructType *ST, - OSTREAM_TYPE &O, + llvm::raw_ostream &O, size_t stackSize, uint32_t Buffer, uint32_t mLitIdx, @@ -832,7 +832,7 @@ AMDILKernelManager::printCopyStructPrivate(const StructType *ST, } } -void AMDILKernelManager::printKernelArgs(OSTREAM_TYPE &O) { +void AMDILKernelManager::printKernelArgs(llvm::raw_ostream &O) { std::string version(";version:"); version += itostr(AMDIL_MAJOR_VERSION) + ":" + itostr(AMDIL_MINOR_VERSION) + ":" + itostr(AMDIL_REVISION_NUMBER); @@ -961,7 +961,7 @@ void AMDILKernelManager::printKernelArgs(OSTREAM_TYPE &O) { O << ";ARGEND:" << mName << "\n"; } -void AMDILKernelManager::printArgCopies(OSTREAM_TYPE &O, +void AMDILKernelManager::printArgCopies(llvm::raw_ostream &O, AMDILAsmPrinter *RegNames) { Function::const_arg_iterator I = mMF->getFunction()->arg_begin(); @@ -1330,7 +1330,7 @@ AMDILKernelManager::getTypeName(const Type *ptr, const char *symTab) return "unknown"; } -void AMDILKernelManager::emitLiterals(OSTREAM_TYPE &O) { +void AMDILKernelManager::emitLiterals(llvm::raw_ostream &O) { char buffer[256]; std::map<uint32_t, uint32_t>::iterator ilb, ile; for (ilb = mMFI->begin_32(), ile = mMFI->end_32(); ilb != ile; ++ilb) { diff --git a/lib/Target/AMDIL/AMDILKernelManager.h b/lib/Target/AMDIL/AMDILKernelManager.h index dee78fd7ae3..e22d6a8ba2a 100644 --- a/lib/Target/AMDIL/AMDILKernelManager.h +++ b/lib/Target/AMDIL/AMDILKernelManager.h @@ -108,29 +108,29 @@ public: /// Process the specific kernel parsing out the parameter information for the /// kernel. - void processArgMetadata(OSTREAM_TYPE &O, + void processArgMetadata(llvm::raw_ostream &O, uint32_t buf, bool kernel); /// Prints the header for the kernel which includes the groupsize declaration /// and calculation of the local/group/global id's. - void printHeader(AMDILAsmPrinter *AsmPrinter, OSTREAM_TYPE &O, + void printHeader(AMDILAsmPrinter *AsmPrinter, llvm::raw_ostream &O, const std::string &name); - virtual void printDecls(AMDILAsmPrinter *AsmPrinter, OSTREAM_TYPE &O); - virtual void printGroupSize(OSTREAM_TYPE &O); + virtual void printDecls(AMDILAsmPrinter *AsmPrinter, llvm::raw_ostream &O); + virtual void printGroupSize(llvm::raw_ostream &O); /// Copies the data from the runtime setup constant buffers into registers so /// that the program can correctly access memory or data that was set by the /// host program. - void printArgCopies(OSTREAM_TYPE &O, AMDILAsmPrinter* RegNames); + void printArgCopies(llvm::raw_ostream &O, AMDILAsmPrinter* RegNames); /// Prints out the end of the function. - void printFooter(OSTREAM_TYPE &O); + void printFooter(llvm::raw_ostream &O); /// Prints out the metadata for the specific function depending if it is a /// kernel or not. - void printMetaData(OSTREAM_TYPE &O, uint32_t id, bool isKernel = false); + void printMetaData(llvm::raw_ostream &O, uint32_t id, bool isKernel = false); /// Set bool value on whether to consider the function a kernel or a normal /// function. @@ -148,7 +148,7 @@ public: /// Flag that specifies whether this function has a kernel wrapper. bool wasKernel(); - void getIntrinsicSetup(AMDILAsmPrinter *AsmPrinter, OSTREAM_TYPE &O); + void getIntrinsicSetup(AMDILAsmPrinter *AsmPrinter, llvm::raw_ostream &O); // Returns whether a compiler needs to insert a write to memory or not. bool useCompilerWrite(const MachineInstr *MI); @@ -159,7 +159,7 @@ public: const char *getTypeName(const Type *name, const char * symTab); - void emitLiterals(OSTREAM_TYPE &O); + void emitLiterals(llvm::raw_ostream &O); // Set the uav id for the specific pointer value. If value is NULL, then the // ID sets the default ID. @@ -172,9 +172,9 @@ private: /// Helper function that prints the actual metadata and should only be called /// by printMetaData. - void printKernelArgs(OSTREAM_TYPE &O); + void printKernelArgs(llvm::raw_ostream &O); void printCopyStructPrivate(const StructType *ST, - OSTREAM_TYPE &O, + llvm::raw_ostream &O, size_t stackSize, uint32_t Buffer, uint32_t mLitIdx, @@ -182,7 +182,7 @@ private: virtual void printConstantToRegMapping(AMDILAsmPrinter *RegNames, uint32_t &LII, - OSTREAM_TYPE &O, + llvm::raw_ostream &O, uint32_t &counter, uint32_t Buffer, uint32_t n, diff --git a/lib/Target/AMDIL/AMDILLLVMVersion.h b/lib/Target/AMDIL/AMDILLLVMVersion.h index 472c17ecac4..1dd19775bd8 100644 --- a/lib/Target/AMDIL/AMDILLLVMVersion.h +++ b/lib/Target/AMDIL/AMDILLLVMVersion.h @@ -54,9 +54,6 @@ #ifndef _AMDIL_LLVM_VERSION_H_ #define _AMDIL_LLVM_VERSION_H_ -// Macro that expands into the correct type for output streams -#define OSTREAM_TYPE llvm::raw_ostream - // AMDILAsmPrinter.cpp macros #define AMDIL_ASM_PRINTER_ARGUMENTS TargetMachine& TM, MCStreamer &Streamer #define ASM_PRINTER_ARGUMENTS TM, Streamer diff --git a/lib/Target/AMDIL/AMDILModuleInfo.cpp b/lib/Target/AMDIL/AMDILModuleInfo.cpp index f20e5eacf6c..e96e58939c1 100644 --- a/lib/Target/AMDIL/AMDILModuleInfo.cpp +++ b/lib/Target/AMDIL/AMDILModuleInfo.cpp @@ -932,17 +932,17 @@ const Value *AMDILModuleInfo::getConstPtrValue(const AMDILKernel *krnl, } static void -dumpZeroElements(StructType * const T, OSTREAM_TYPE &O, bool asBytes); +dumpZeroElements(StructType * const T, llvm::raw_ostream &O, bool asBytes); static void -dumpZeroElements(IntegerType * const T, OSTREAM_TYPE &O, bool asBytes); +dumpZeroElements(IntegerType * const T, llvm::raw_ostream &O, bool asBytes); static void -dumpZeroElements(ArrayType * const T, OSTREAM_TYPE &O, bool asBytes); +dumpZeroElements(ArrayType * const T, llvm::raw_ostream &O, bool asBytes); static void -dumpZeroElements(VectorType * const T, OSTREAM_TYPE &O, bool asBytes); +dumpZeroElements(VectorType * const T, llvm::raw_ostream &O, bool asBytes); static void -dumpZeroElements(Type * const T, OSTREAM_TYPE &O, bool asBytes); +dumpZeroElements(Type * const T, llvm::raw_ostream &O, bool asBytes); -void dumpZeroElements(Type * const T, OSTREAM_TYPE &O, bool asBytes) { +void dumpZeroElements(Type * const T, llvm::raw_ostream &O, bool asBytes) { if (!T) { return; } @@ -995,7 +995,7 @@ void dumpZeroElements(Type * const T, OSTREAM_TYPE &O, bool asBytes) { } void -dumpZeroElements(StructType * const ST, OSTREAM_TYPE &O, bool asBytes) { +dumpZeroElements(StructType * const ST, llvm::raw_ostream &O, bool asBytes) { if (!ST) { return; } @@ -1009,7 +1009,7 @@ dumpZeroElements(StructType * const ST, OSTREAM_TYPE &O, bool asBytes) { } void -dumpZeroElements(IntegerType * const IT, OSTREAM_TYPE &O, bool asBytes) { +dumpZeroElements(IntegerType * const IT, llvm::raw_ostream &O, bool asBytes) { if (asBytes) { unsigned byteWidth = (IT->getBitWidth() >> 3); for (unsigned x = 0; x < byteWidth; ++x) { @@ -1019,7 +1019,7 @@ dumpZeroElements(IntegerType * const IT, OSTREAM_TYPE &O, bool asBytes) { } void -dumpZeroElements(ArrayType * const AT, OSTREAM_TYPE &O, bool asBytes) { +dumpZeroElements(ArrayType * const AT, llvm::raw_ostream &O, bool asBytes) { size_t size = AT->getNumElements(); for (size_t x = 0; x < size; ++x) { dumpZeroElements(AT->getElementType(), O, asBytes); @@ -1027,7 +1027,7 @@ dumpZeroElements(ArrayType * const AT, OSTREAM_TYPE &O, bool asBytes) { } void -dumpZeroElements(VectorType * const VT, OSTREAM_TYPE &O, bool asBytes) { +dumpZeroElements(VectorType * const VT, llvm::raw_ostream &O, bool asBytes) { size_t size = VT->getNumElements(); for (size_t x = 0; x < size; ++x) { dumpZeroElements(VT->getElementType(), O, asBytes); @@ -1035,7 +1035,7 @@ dumpZeroElements(VectorType * const VT, OSTREAM_TYPE &O, bool asBytes) { } void AMDILModuleInfo::printConstantValue(const Constant *CAval, - OSTREAM_TYPE &O, bool asBytes) { + llvm::raw_ostream &O, bool asBytes) { if (const ConstantFP *CFP = dyn_cast<ConstantFP>(CAval)) { bool isDouble = &CFP->getValueAPF().getSemantics()==&APFloat::IEEEdouble; if (isDouble) { @@ -1197,7 +1197,7 @@ static bool isStruct(Type * const T) } -void AMDILModuleInfo::dumpDataToCB(OSTREAM_TYPE &O, AMDILKernelManager *km, +void AMDILModuleInfo::dumpDataToCB(llvm::raw_ostream &O, AMDILKernelManager *km, uint32_t id) { uint32_t size = 0; for (StringMap<AMDILConstPtr>::iterator cmb = consts_begin(), @@ -1264,7 +1264,7 @@ void AMDILModuleInfo::dumpDataToCB(OSTREAM_TYPE &O, AMDILKernelManager *km, } void -AMDILModuleInfo::dumpDataSection(OSTREAM_TYPE &O, AMDILKernelManager *km) { +AMDILModuleInfo::dumpDataSection(llvm::raw_ostream &O, AMDILKernelManager *km) { if (mConstMems.empty() && !mCurrentCPOffset) { return; } else { diff --git a/lib/Target/AMDIL/AMDILModuleInfo.h b/lib/Target/AMDIL/AMDILModuleInfo.h index 5d44c9a01da..c93ec40b256 100644 --- a/lib/Target/AMDIL/AMDILModuleInfo.h +++ b/lib/Target/AMDIL/AMDILModuleInfo.h @@ -116,7 +116,7 @@ namespace llvm { bool isKernel(const llvm::StringRef &name) const; /// Dump the data section to the output stream for the given kernel. - //void dumpDataSection(OSTREAM_TYPE &O, AMDILKernelManager *km); + //void dumpDataSection(llvm::raw_ostream &O, AMDILKernelManager *km); /// Iterate through the constants that are global to the compilation unit. StringMap<AMDILConstPtr>::iterator consts_begin(); @@ -169,7 +169,7 @@ namespace llvm { void parseImageAnnotate(const GlobalValue *G); void parseConstantPtrAnnotate(const GlobalValue *G); void printConstantValue(const Constant *CAval, - OSTREAM_TYPE& O, + llvm::raw_ostream& O, bool asByte); void parseKernelInformation(const Value *V); void parseAutoArray(const GlobalValue *G, bool isRegion); diff --git a/lib/Target/AMDIL/AMDILTargetMachine.cpp b/lib/Target/AMDIL/AMDILTargetMachine.cpp index 08591cac8fb..221e06d9a28 100644 --- a/lib/Target/AMDIL/AMDILTargetMachine.cpp +++ b/lib/Target/AMDIL/AMDILTargetMachine.cpp @@ -196,7 +196,7 @@ AMDILTargetMachine::addPreEmitPass(PassManagerBase &PM) } void -AMDILTargetMachine::dump(OSTREAM_TYPE &O) +AMDILTargetMachine::dump(llvm::raw_ostream &O) { if (!mDebugMode) { return; diff --git a/lib/Target/AMDIL/AMDILTargetMachine.h b/lib/Target/AMDIL/AMDILTargetMachine.h index e2afe1a7d03..88a9e5c5d00 100644 --- a/lib/Target/AMDIL/AMDILTargetMachine.h +++ b/lib/Target/AMDIL/AMDILTargetMachine.h @@ -111,7 +111,7 @@ namespace llvm addPreRegAlloc(PassManagerBase &PM); virtual bool addPostRegAlloc(PassManagerBase &PM); - void dump(OSTREAM_TYPE &O); + void dump(llvm::raw_ostream &O); void setDebug(bool debugMode); bool getDebug() const; CodeGenOpt::Level getOptLevel() const { return mOptLevel; } diff --git a/lib/Target/AMDIL/AMDILUtilityFunctions.cpp b/lib/Target/AMDIL/AMDILUtilityFunctions.cpp index 5c9e3625db7..745273d5414 100644 --- a/lib/Target/AMDIL/AMDILUtilityFunctions.cpp +++ b/lib/Target/AMDIL/AMDILUtilityFunctions.cpp @@ -563,7 +563,7 @@ const llvm::Value *getBasePointerValue(const llvm::MachineInstr *MI) { return moVal; } -bool commaPrint(int i, OSTREAM_TYPE &O) { +bool commaPrint(int i, llvm::raw_ostream &O) { O << ":" << i; return false; } diff --git a/lib/Target/AMDIL/AMDILUtilityFunctions.h b/lib/Target/AMDIL/AMDILUtilityFunctions.h index b3fa8a47392..d9265c57c55 100644 --- a/lib/Target/AMDIL/AMDILUtilityFunctions.h +++ b/lib/Target/AMDIL/AMDILUtilityFunctions.h @@ -396,7 +396,7 @@ case Instr##_v4f32: \ case Instr##_v2i64: \ case Instr##_v2f64: -bool commaPrint(int i, OSTREAM_TYPE &O); +bool commaPrint(int i, llvm::raw_ostream &O); /// Helper function to get the currently get/set flags. void getAsmPrinterFlags(llvm::MachineInstr *MI, llvm::AMDILAS::InstrResEnc &curRes); void setAsmPrinterFlags(llvm::MachineInstr *MI, llvm::AMDILAS::InstrResEnc &curRes); |