Skip to content
  • Nikolai Kosjar's avatar
    Clang: Add possibility to "pgo-train" libclang with a batch file · 07f4ae62
    Nikolai Kosjar authored
    
    
    This allows to start Qt Creator in batch processing mode:
    
      $ export QTC_CLANG_BATCH=/path/to/file
      $ export QT_LOGGING_RULES=qtc.clangcodemodel.batch=true
      $ ./qtcreator -load ClangCodeModel
    
    The batch file will be executed and Qt Creator will exit. Advanced
    logging output can be activated as stated above.
    
    Note that it is required that the project was already configured/set up
    properly with the used settingspath, otherwise the wrong configuration
    will be taken or a pop-up dialog will block the execution.
    
    A small example follows that covers all the understood and so far needed
    batch file commands in order to train libclang for profile guided
    optimization. ${PWD} expands to the directory of the batch file.
    
        openProject "${PWD}/calendarwidget.pro"
    
        # Initial parsing
        openDocument "${PWD}/window.cpp"
        closeAllDocuments
        openDocument "${PWD}/window.cpp"
    
        # Reparse
        setCursor 478 1
        insertText " "
        insertText " "
        insertText " "
    
        # Completion
        complete
        complete
        complete
    
        # Member completion
        insertText "comboBox->"
        complete
        complete
        complete
    
        # Wait in order to inspect the result
        processEvents 3000
    
    Change-Id: Ib30526036f999e530f0c01d42a196a1e311e2c4c
    Reviewed-by: default avatarDavid Schulz <david.schulz@qt.io>
    07f4ae62