moved PtxString to Globals

This commit is contained in:
Evghenii
2013-10-30 21:05:22 +01:00
parent f9ec1a0097
commit 8db3d25844
2 changed files with 5 additions and 4 deletions

1
ispc.h
View File

@@ -576,6 +576,7 @@ struct Globals {
/** Indicates that alignment in memory allocation routines should be /** Indicates that alignment in memory allocation routines should be
forced to have given value. -1 value means natural alignment for the platforms. */ forced to have given value. -1 value means natural alignment for the platforms. */
int forceAlignment; int forceAlignment;
std::string PtxString;
}; };
enum { enum {

View File

@@ -2325,7 +2325,7 @@ Module::CompileAndOutput(const char *srcFile,
++suffix_orig; ++suffix_orig;
assert(suffix_orig!=NULL); assert(suffix_orig!=NULL);
std::string PtxString; g->PtxString = std::string();
for (int itarget = 0; itarget < 2; itarget++) for (int itarget = 0; itarget < 2; itarget++)
{ {
@@ -2378,7 +2378,7 @@ Module::CompileAndOutput(const char *srcFile,
pm.add(new llvm::DataLayout(*g->target->getDataLayout())); pm.add(new llvm::DataLayout(*g->target->getDataLayout()));
#endif #endif
llvm::raw_string_ostream rso(PtxString); llvm::raw_string_ostream rso(g->PtxString);
llvm::formatted_raw_ostream fos(rso); llvm::formatted_raw_ostream fos(rso);
llvm::TargetMachine::CodeGenFileType fileType = llvm::TargetMachine::CGFT_AssemblyFile; llvm::TargetMachine::CodeGenFileType fileType = llvm::TargetMachine::CGFT_AssemblyFile;
@@ -2391,9 +2391,9 @@ Module::CompileAndOutput(const char *srcFile,
llvm::Module *module = m->module; llvm::Module *module = m->module;
pm.run(*module); pm.run(*module);
fos.flush(); fos.flush();
assert(!PtxString.empty()); assert(!g->PtxString.empty());
#if 0 #if 0
std::cout << PtxString << std::endl; std::cout << g->PtxString << std::endl;
#endif #endif
} }