Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Invoke CDT programmatically: performances
Invoke CDT programmatically: performances [message #1018150] Wed, 13 March 2013 09:10
Federico Tomassetti is currently offline Federico TomassettiFriend
Messages: 190
Registered: July 2009
Location: Dublin
Senior Member

Hi,
I invoke CDT programmatically on a large number of variants of small pieces of code and it tooks a loooong time. I am looking for way to factorize the initialization of other tricks to reduce this time.

Currently I invoke for each variant this method:

private IASTTranslationUnit getTranslationUnit(String code, File currentDir, IIncludeFileResolutionHeuristics includeFileResolutionHeuristics) throws AstNotBuiltException { 
  if (code == null) { throw new IllegalArgumentException("Null code given"); } 
     
  // FIXME it avoids temporarily a ClassNotFoundException 
  code = takeOutDateAndTimeMacros(code); 
     
  CodeReader reader = CPreprocessorParser.getReader(code); 
  Map definedSymbols = new HashMap(); 
  IScannerInfo info = new ScannerInfo(definedSymbols, headerPathProvider.getIncludePath().toArray); 
  AbstractCodeReaderFactory readerFactory = new MyCodeReaderFactory(includeFileResolutionHeuristics); 
  try { 
    IASTTranslationUnit translationUnit = GCCLanguage.getDefault().getASTTranslationUnit(reader, info, readerFactory, null, log); 
    return translationUnit; 
  } catch (Throwable t) { 
    throw new AstNotBuiltException(t); 
  } 
} 


Previous Topic:eclipse x64 indexing error
Next Topic:add cdt to eclipse for java
Goto Forum:
  


Current Time: Thu Apr 25 08:26:20 GMT 2024

Powered by FUDForum. Page generated in 0.03174 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top