Clang: Allow to time high-level functions

...by enabling the logging rule:

    qtc.clangbackend.timers=true

Change-Id: I085c6bbebc0343b74bcb90119d1ebb80ad49518d
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-07-28 16:04:49 +02:00
parent 3b314e50c8
commit b783bcea60
5 changed files with 52 additions and 8 deletions

View File

@@ -31,6 +31,10 @@
#ifndef CLANGBACKENDIPCDEBUGUTILS_H
#define CLANGBACKENDIPCDEBUGUTILS_H
#include "clangbackendipc_global.h"
#include <QElapsedTimer>
class FileContainer;
class Utf8String;
@@ -39,6 +43,19 @@ namespace ClangBackEnd {
Utf8String debugWriteFileForInspection(const Utf8String &fileContent, const Utf8String &id);
Utf8String debugId(const FileContainer &fileContainer);
class CMBIPC_EXPORT VerboseScopeDurationTimer
{
public:
VerboseScopeDurationTimer(const char *id = 0);
~VerboseScopeDurationTimer();
private:
const char * const id;
QElapsedTimer timer;
};
} // namespace ClangBackEnd
#define TIME_SCOPE_DURATION(id) ClangBackEnd::VerboseScopeDurationTimer scopeDurationTimer(id)
#endif // CLANGBACKENDIPCDEBUGUTILS_H