int main (int argc, const char * argv[]) { graf *pgG; int bCheminer,bCircuit,uSommet; int kbAfficher=1; const int ksSource=1; Appel0(""); ModuleAmorceR(); //OutilTESTER(55); //AlexTESTER(2); int i=1 ; for (i=1; i<=4; i++) switch(i){ case 1 : Compiler("AZE 5 5.2 15.50$"); break; case 2 : Compiler("AZE 5 5.2 25.50$"); break; case 3 : Compiler("AZE 5 5.2 15.60$"); break; case 4 : Compiler("AZE 5 5.2 25.60$"); } if (0) for (uSommet=1;uSommet<10;uSommet++){ GrapheCreer(uSommet,&pgG); GrapheAfficher(pgG,sC4b("Graphe à",sPluriel(pgG->nSommetEnTout,"sommet"),"et",sPluriel(pgG->nArcEnTout,"arc"))); bCheminer=bGrapheCheminerCourt(pgG,ksSource,pgG->nSommetEnTout,kbAfficher); if (!kbAfficher) printf("Il %s un chemin.\n",sPas("y a vraiment",!bCheminer)); GrapheCreer(0,&pgG); } if (0) for (uSommet=10;uSommet<=10;uSommet++){ GrapheCreer(uSommet,&pgG); GrapheArquer(pgG, 1, 4); bGrapheDesarquer(pgG, 4, 2); GrapheAfficher(pgG,sC4b("Graphe à",sPluriel(pgG->nSommetEnTout,"sommet"),"et",sPluriel(pgG->nArcEnTout,"arc"))); bCheminer=bGrapheCheminerLong(pgG,ksSource,pgG->nSommetEnTout,kbAfficher); if (!kbAfficher) printf("Il %s un chemin.\n",sPas("y a vraiment",!bCheminer)); GrapheCreer(0,&pgG); } if (0) for (uSommet=3;uSommet<10;uSommet++){ GrapheCreer(uSommet, &pgG); GrapheInverser(pgG); GrapheAfficher2(pgG,sC4b("Graphe à",sPluriel(pgG->nSommetEnTout,"sommet"),"et",sPluriel(pgG->nArcEnTout,"arc"))); bCircuit=bGrapheCircuite(pgG); s(sC3bp("Il",sNie("y a",!bCircuit,"un","aucun"),"circuit")); GrapheCreer(0,&pgG); } //if (0) FlotTESTER(11); if (0){ GrapheCreer(4,&pgG); GrapheEtager(pgG); GrapheAfficher(pgG,sC4b("Le graphe étagé a",sPluriel(pgG->nSommetEnTout,"sommet"),"et",sPluriel(pgG->nArcEnTout,"arc"))); GrapheCreer(0,&pgG); } Appel1(""); return 0; }
int main ( IN int Argc, IN char **Argv ) { COMPILER_RUN_STATUS Status; SetPrintLevel(WARNING_LOG_LEVEL); CVfrCompiler Compiler(Argc, Argv); Compiler.PreProcess(); Compiler.Compile(); Compiler.AdjustBin(); Compiler.GenBinary(); Compiler.GenCFile(); Compiler.GenRecordListFile (); Status = Compiler.RunStatus (); if ((Status == STATUS_DEAD) || (Status == STATUS_FAILED)) { return 2; } if (gCBuffer.Buffer != NULL) { delete gCBuffer.Buffer; } if (gRBuffer.Buffer != NULL) { delete gRBuffer.Buffer; } return GetUtilityStatus (); }
bool IncludeFixerActionFactory::runInvocation( clang::CompilerInvocation *Invocation, clang::FileManager *Files, std::shared_ptr<clang::PCHContainerOperations> PCHContainerOps, clang::DiagnosticConsumer *Diagnostics) { assert(Invocation->getFrontendOpts().Inputs.size() == 1); // Set up Clang. clang::CompilerInstance Compiler(PCHContainerOps); Compiler.setInvocation(Invocation); Compiler.setFileManager(Files); // Create the compiler's actual diagnostics engine. We want to drop all // diagnostics here. Compiler.createDiagnostics(new clang::IgnoringDiagConsumer, /*ShouldOwnClient=*/true); Compiler.createSourceManager(*Files); // We abort on fatal errors so don't let a large number of errors become // fatal. A missing #include can cause thousands of errors. Compiler.getDiagnostics().setErrorLimit(0); // Run the parser, gather missing includes. auto ScopedToolAction = llvm::make_unique<Action>(SymbolIndexMgr, MinimizeIncludePaths); Compiler.ExecuteAction(*ScopedToolAction); Context = ScopedToolAction->getIncludeFixerContext( Compiler.getSourceManager(), Compiler.getPreprocessor().getHeaderSearchInfo()); // Technically this should only return true if we're sure that we have a // parseable file. We don't know that though. Only inform users of fatal // errors. return !Compiler.getDiagnostics().hasFatalErrorOccurred(); }
bool FrontendActionFactory::runInvocation( CompilerInvocation *Invocation, FileManager *Files, std::shared_ptr<PCHContainerOperations> PCHContainerOps, DiagnosticConsumer *DiagConsumer) { // Create a compiler instance to handle the actual work. clang::CompilerInstance Compiler(PCHContainerOps); Compiler.setInvocation(Invocation); Compiler.setFileManager(Files); // The FrontendAction can have lifetime requirements for Compiler or its // members, and we need to ensure it's deleted earlier than Compiler. So we // pass it to an std::unique_ptr declared after the Compiler variable. std::unique_ptr<FrontendAction> ScopedToolAction(create()); // Create the compiler's actual diagnostics engine. Compiler.createDiagnostics(DiagConsumer, /*ShouldOwnClient=*/false); if (!Compiler.hasDiagnostics()) return false; Compiler.createSourceManager(*Files); const bool Success = Compiler.ExecuteAction(*ScopedToolAction); Files->clearStatCaches(); return Success; }
// Compiles a blueprint. void FKismet2CompilerModule::CompileBlueprintInner(class UBlueprint* Blueprint, const FKismetCompilerOptions& CompileOptions, FCompilerResultsLog& Results, TArray<UObject*>* ObjLoaded) { FBlueprintIsBeingCompiledHelper BeingCompiled(Blueprint); Blueprint->CurrentMessageLog = &Results; // Early out if blueprint parent is missing if (Blueprint->ParentClass == NULL) { Results.Error(*LOCTEXT("KismetCompileError_MalformedParentClasss", "Blueprint @@ has missing or NULL parent class.").ToString(), Blueprint); } else { // Loop through all external compiler delegates attempting to compile the blueprint. bool Compiled = false; for ( IBlueprintCompiler* Compiler : Compilers ) { if ( Compiler->CanCompile(Blueprint) ) { Compiled = true; Compiler->Compile(Blueprint, CompileOptions, Results, ObjLoaded); break; } } // if no one handles it, then use the default blueprint compiler. if ( !Compiled ) { if ( UAnimBlueprint* AnimBlueprint = Cast<UAnimBlueprint>(Blueprint) ) { FAnimBlueprintCompiler Compiler(AnimBlueprint, Results, CompileOptions, ObjLoaded); Compiler.Compile(); check(Compiler.NewClass); } else { FKismetCompilerContext Compiler(Blueprint, Results, CompileOptions, ObjLoaded); Compiler.Compile(); check(Compiler.NewClass); } } } Blueprint->CurrentMessageLog = NULL; }
void Compile(UBlueprint* Blueprint, const FKismetCompilerOptions& CompileOptions, FCompilerResultsLog& Results, TArray<UObject*>* ObjLoaded) { if ( UWidgetBlueprint* WidgetBlueprint = CastChecked<UWidgetBlueprint>(Blueprint) ) { FWidgetBlueprintCompiler Compiler(WidgetBlueprint, Results, CompileOptions, ObjLoaded); Compiler.Compile(); check(Compiler.NewClass); } }
FReply CompileWidgetBlueprint(UBlueprint* Blueprint, const FKismetCompilerOptions& CompileOptions, FCompilerResultsLog& Results, TArray<UObject*>* ObjLoaded) { if ( UWidgetBlueprint* WidgetBlueprint = Cast<UWidgetBlueprint>(Blueprint) ) { FWidgetBlueprintCompiler Compiler(WidgetBlueprint, Results, CompileOptions, ObjLoaded); Compiler.Compile(); check(Compiler.NewClass); return FReply::Handled(); } return FReply::Unhandled(); }
GouraudRenderer::GouraudRenderer(ID3D11Device& Device, ID3D11DeviceContext& DeviceContext) :m_Device(Device) ,m_DeviceContext(DeviceContext) ,m_VertexBuffer(Device, DeviceContext, 4096) ,m_IndexBuffer(Device, DeviceContext, DynamicGPUBufferHelpers::Fan2StripIndices(m_VertexBuffer.GetReserved())) { ShaderCompiler Compiler(m_Device, L"Render11\\Gouraud.hlsl"); m_pVertexShader = Compiler.CompileVertexShader(); const D3D11_INPUT_ELEMENT_DESC InputElementDescs[] = { {"Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0}, {"Color", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0}, {"TexCoord", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0}, {"BlendIndices", 0, DXGI_FORMAT_R32_UINT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0} //Todo make 8 bits, if necessary at all -> can't, hlsl doesn't support 8 bit data type }; m_pInputLayout = Compiler.CreateInputLayout(InputElementDescs, _countof(InputElementDescs)); m_pPixelShader = Compiler.CompilePixelShader(); }
bool CExportTest::Setup() { HMODULE hModule = LoadLibrary(_T("ExportTest.dll")); if (hModule == NULL) { AfxMessageBox(_T("Could not load ExportTest.dll")); return false; } ImportFuncs.LoadFileFunc = (LoadFile_t)GetProcAddress(hModule, "LoadFile"); ImportFuncs.RunFrameFunc = (RunFrame_t)GetProcAddress(hModule, "RunFrame"); ImportFuncs.ReadResultFunc = (ReadResult_t)GetProcAddress(hModule, "ReadResult"); if (ImportFuncs.LoadFileFunc == NULL) return false; if (ImportFuncs.RunFrameFunc == NULL) return false; if (ImportFuncs.ReadResultFunc == NULL) return false; CFamiTrackerDoc *pDoc = CFamiTrackerDoc::GetDoc(); CCompiler Compiler(pDoc, NULL); char *pMemory; pMemory = new char[0x10000]; //stNSFHeader header; int song = 0; Compiler.ExportTest(pMemory, m_pHeader, MACHINE_NTSC); // Setup memory ImportFuncs.LoadFileFunc(pMemory, m_pHeader->LoadAddr, 0x10000); SAFE_RELEASE_ARRAY(pMemory); return true; }
INT32 main ( IN INT32 Argc, IN INT8 **Argv ) { COMPILER_RUN_STATUS Status; CVfrCompiler Compiler(Argc, Argv); Compiler.PreProcess(); Compiler.Compile(); Compiler.GenBinary(); Compiler.GenCFile(); Compiler.GenRecordListFile (); Status = Compiler.RunStatus (); if ((Status == STATUS_DEAD) || (Status == STATUS_FAILED)) { return 2; } return 0; }
bool CExportTest::Setup(LPCTSTR lpszFile) { if (m_hModule == NULL) m_hModule = ::LoadLibrary(_T("ExportTest.dll")); if (m_hModule == NULL) { AfxMessageBox(_T("Could not load ExportTest.dll")); return false; } ImportFuncs.LoadFileFunc = (LoadFile_t)GetProcAddress(m_hModule, "LoadFile"); ImportFuncs.RunFrameFunc = (RunFrame_t)GetProcAddress(m_hModule, "RunFrame"); ImportFuncs.ReadResultFunc = (ReadResult_t)GetProcAddress(m_hModule, "ReadResult"); if (ImportFuncs.LoadFileFunc == NULL) return false; if (ImportFuncs.RunFrameFunc == NULL) return false; if (ImportFuncs.ReadResultFunc == NULL) return false; TCHAR TempPath[MAX_PATH]; TCHAR TempFile[MAX_PATH]; if (lpszFile == NULL || strlen(lpszFile) == 0) { // Get a temporary filename GetTempPath(MAX_PATH, TempPath); GetTempFileName(TempPath, _T("NSF-TEST"), 0, TempFile); TRACE1("ExportTest: Creating file %s\n", TempFile); // Export file CFamiTrackerDoc *pDoc = CFamiTrackerDoc::GetDoc(); CCompiler Compiler(pDoc, NULL); Compiler.ExportNSF(CString(TempFile), MACHINE_NTSC); } else { _tcscpy_s(TempFile, MAX_PATH, lpszFile); } CFile inFile(TempFile, CFile::modeRead); int size = (int)inFile.GetLength() - sizeof(stNSFHeader); char *pMemory = new char[size]; inFile.Read(m_pHeader, sizeof(stNSFHeader)); inFile.Read(pMemory, size); inFile.Close(); if (lpszFile == NULL) { // Delete temporary file DeleteFile(TempFile); } m_iFileSize = size; // Setup memory ImportFuncs.LoadFileFunc(pMemory, size, m_pHeader); SAFE_RELEASE_ARRAY(pMemory); return true; }