2016-11-30 02:24:01 +08:00
|
|
|
//===--- PPCallbacksTracker.h - Preprocessor tracking -----------*- C++ -*-===//
|
2013-10-31 20:23:32 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2013-10-31 20:23:32 +08:00
|
|
|
//
|
2016-11-30 02:24:01 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2013-10-31 20:23:32 +08:00
|
|
|
///
|
|
|
|
/// \file
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Classes and definitions for preprocessor tracking.
|
2013-10-31 20:23:32 +08:00
|
|
|
///
|
|
|
|
/// The core definition is the PPCallbacksTracker class, derived from Clang's
|
|
|
|
/// PPCallbacks class from the Lex library, which overrides all the callbacks
|
|
|
|
/// and collects information about each callback call, saving it in a
|
|
|
|
/// data structure built up of CallbackCall and Argument objects, which
|
|
|
|
/// record the preprocessor callback name and arguments in high-level string
|
|
|
|
/// form for later inspection.
|
|
|
|
///
|
2016-11-30 02:24:01 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2013-10-31 20:23:32 +08:00
|
|
|
|
|
|
|
#ifndef PPTRACE_PPCALLBACKSTRACKER_H
|
|
|
|
#define PPTRACE_PPCALLBACKSTRACKER_H
|
|
|
|
|
|
|
|
#include "clang/Lex/PPCallbacks.h"
|
|
|
|
#include "clang/Lex/Preprocessor.h"
|
2016-11-30 02:24:01 +08:00
|
|
|
#include "clang/Basic/SourceManager.h"
|
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
|
|
|
#include "llvm/ADT/SmallSet.h"
|
[pp-trace] Delete -ignore and add a new option -callbacks
Summary:
-ignore specifies a list of PP callbacks to ignore. It cannot express a
whitelist, which may be more useful than a blacklist.
Add a new option -callbacks to replace it.
-ignore= (default) => -callbacks='*' (default)
-ignore=FileChanged,FileSkipped => -callbacks='*,-FileChanged,-FileSkipped'
-callbacks='Macro*' : print only MacroDefined,MacroExpands,MacroUndefined,...
Reviewers: juliehockett, aaron.ballman, alexfh, ioeric
Reviewed By: aaron.ballman
Subscribers: nemanjai, kbarton, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59296
llvm-svn: 356366
2019-03-18 21:30:17 +08:00
|
|
|
#include "llvm/ADT/StringMap.h"
|
2016-11-30 02:24:01 +08:00
|
|
|
#include "llvm/ADT/StringRef.h"
|
[pp-trace] Delete -ignore and add a new option -callbacks
Summary:
-ignore specifies a list of PP callbacks to ignore. It cannot express a
whitelist, which may be more useful than a blacklist.
Add a new option -callbacks to replace it.
-ignore= (default) => -callbacks='*' (default)
-ignore=FileChanged,FileSkipped => -callbacks='*,-FileChanged,-FileSkipped'
-callbacks='Macro*' : print only MacroDefined,MacroExpands,MacroUndefined,...
Reviewers: juliehockett, aaron.ballman, alexfh, ioeric
Reviewed By: aaron.ballman
Subscribers: nemanjai, kbarton, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59296
llvm-svn: 356366
2019-03-18 21:30:17 +08:00
|
|
|
#include "llvm/Support/GlobPattern.h"
|
2016-11-30 02:24:01 +08:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2013-10-31 20:23:32 +08:00
|
|
|
|
2019-03-24 15:21:32 +08:00
|
|
|
namespace clang {
|
|
|
|
namespace pp_trace {
|
2013-10-31 20:23:32 +08:00
|
|
|
|
2019-03-24 15:21:32 +08:00
|
|
|
// This struct represents one callback function argument by name and value.
|
|
|
|
struct Argument {
|
2013-10-31 20:23:32 +08:00
|
|
|
std::string Name;
|
|
|
|
std::string Value;
|
|
|
|
};
|
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// This class represents one callback call by name and an array
|
2013-10-31 20:23:32 +08:00
|
|
|
/// of arguments.
|
|
|
|
class CallbackCall {
|
|
|
|
public:
|
|
|
|
CallbackCall(llvm::StringRef Name) : Name(Name) {}
|
2016-11-30 02:24:01 +08:00
|
|
|
CallbackCall() = default;
|
2013-10-31 20:23:32 +08:00
|
|
|
|
|
|
|
std::string Name;
|
|
|
|
std::vector<Argument> Arguments;
|
|
|
|
};
|
|
|
|
|
[pp-trace] Delete -ignore and add a new option -callbacks
Summary:
-ignore specifies a list of PP callbacks to ignore. It cannot express a
whitelist, which may be more useful than a blacklist.
Add a new option -callbacks to replace it.
-ignore= (default) => -callbacks='*' (default)
-ignore=FileChanged,FileSkipped => -callbacks='*,-FileChanged,-FileSkipped'
-callbacks='Macro*' : print only MacroDefined,MacroExpands,MacroUndefined,...
Reviewers: juliehockett, aaron.ballman, alexfh, ioeric
Reviewed By: aaron.ballman
Subscribers: nemanjai, kbarton, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59296
llvm-svn: 356366
2019-03-18 21:30:17 +08:00
|
|
|
using FilterType = std::vector<std::pair<llvm::GlobPattern, bool>>;
|
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// This class overrides the PPCallbacks class for tracking preprocessor
|
2013-10-31 20:23:32 +08:00
|
|
|
/// activity by means of its callback functions.
|
|
|
|
///
|
|
|
|
/// This object is given a vector for storing the trace information, built up
|
|
|
|
/// of CallbackCall and subordinate Argument objects for representing the
|
|
|
|
/// callback calls and their arguments. It's a reference so the vector can
|
|
|
|
/// exist beyond the lifetime of this object, because it's deleted by the
|
|
|
|
/// preprocessor automatically in its destructor.
|
|
|
|
///
|
|
|
|
/// This class supports a mechanism for inhibiting trace output for
|
|
|
|
/// specific callbacks by name, for the purpose of eliminating output for
|
|
|
|
/// callbacks of no interest that might clutter the output.
|
|
|
|
///
|
|
|
|
/// Following the constructor and destructor function declarations, the
|
2020-04-05 14:28:11 +08:00
|
|
|
/// overridden callback functions are defined. The remaining functions are
|
2013-10-31 20:23:32 +08:00
|
|
|
/// helpers for recording the trace data, to reduce the coupling between it
|
|
|
|
/// and the recorded data structure.
|
2019-03-24 15:21:32 +08:00
|
|
|
class PPCallbacksTracker : public PPCallbacks {
|
2013-10-31 20:23:32 +08:00
|
|
|
public:
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Note that all of the arguments are references, and owned
|
2013-10-31 20:23:32 +08:00
|
|
|
/// by the caller.
|
[pp-trace] Delete -ignore and add a new option -callbacks
Summary:
-ignore specifies a list of PP callbacks to ignore. It cannot express a
whitelist, which may be more useful than a blacklist.
Add a new option -callbacks to replace it.
-ignore= (default) => -callbacks='*' (default)
-ignore=FileChanged,FileSkipped => -callbacks='*,-FileChanged,-FileSkipped'
-callbacks='Macro*' : print only MacroDefined,MacroExpands,MacroUndefined,...
Reviewers: juliehockett, aaron.ballman, alexfh, ioeric
Reviewed By: aaron.ballman
Subscribers: nemanjai, kbarton, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59296
llvm-svn: 356366
2019-03-18 21:30:17 +08:00
|
|
|
/// \param Filters - List of (Glob,Enabled) pairs used to filter callbacks.
|
2013-10-31 20:23:32 +08:00
|
|
|
/// \param CallbackCalls - Trace buffer.
|
|
|
|
/// \param PP - The preprocessor. Needed for getting some argument strings.
|
[pp-trace] Delete -ignore and add a new option -callbacks
Summary:
-ignore specifies a list of PP callbacks to ignore. It cannot express a
whitelist, which may be more useful than a blacklist.
Add a new option -callbacks to replace it.
-ignore= (default) => -callbacks='*' (default)
-ignore=FileChanged,FileSkipped => -callbacks='*,-FileChanged,-FileSkipped'
-callbacks='Macro*' : print only MacroDefined,MacroExpands,MacroUndefined,...
Reviewers: juliehockett, aaron.ballman, alexfh, ioeric
Reviewed By: aaron.ballman
Subscribers: nemanjai, kbarton, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59296
llvm-svn: 356366
2019-03-18 21:30:17 +08:00
|
|
|
PPCallbacksTracker(const FilterType &Filters,
|
2013-10-31 20:23:32 +08:00
|
|
|
std::vector<CallbackCall> &CallbackCalls,
|
2019-03-24 15:21:32 +08:00
|
|
|
Preprocessor &PP);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
2015-04-11 15:59:33 +08:00
|
|
|
~PPCallbacksTracker() override;
|
2013-10-31 20:23:32 +08:00
|
|
|
|
2020-04-05 14:28:11 +08:00
|
|
|
// Overridden callback functions.
|
2013-10-31 20:23:32 +08:00
|
|
|
|
2019-03-24 15:21:32 +08:00
|
|
|
void FileChanged(SourceLocation Loc, PPCallbacks::FileChangeReason Reason,
|
|
|
|
SrcMgr::CharacteristicKind FileType,
|
|
|
|
FileID PrevFID = FileID()) override;
|
2019-08-27 09:03:25 +08:00
|
|
|
void FileSkipped(const FileEntryRef &SkippedFile, const Token &FilenameTok,
|
2019-03-24 15:21:32 +08:00
|
|
|
SrcMgr::CharacteristicKind FileType) override;
|
2013-10-31 20:23:32 +08:00
|
|
|
bool FileNotFound(llvm::StringRef FileName,
|
2014-03-02 18:20:11 +08:00
|
|
|
llvm::SmallVectorImpl<char> &RecoveryPath) override;
|
2019-03-24 15:21:32 +08:00
|
|
|
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
|
2013-10-31 20:23:32 +08:00
|
|
|
llvm::StringRef FileName, bool IsAngled,
|
2019-03-24 15:21:32 +08:00
|
|
|
CharSourceRange FilenameRange, const FileEntry *File,
|
2013-10-31 20:23:32 +08:00
|
|
|
llvm::StringRef SearchPath,
|
2019-03-24 15:21:32 +08:00
|
|
|
llvm::StringRef RelativePath, const Module *Imported,
|
|
|
|
SrcMgr::CharacteristicKind FileType) override;
|
|
|
|
void moduleImport(SourceLocation ImportLoc, ModuleIdPath Path,
|
|
|
|
const Module *Imported) override;
|
2014-03-02 18:20:11 +08:00
|
|
|
void EndOfMainFile() override;
|
2019-03-24 15:21:32 +08:00
|
|
|
void Ident(SourceLocation Loc, llvm::StringRef str) override;
|
|
|
|
void PragmaDirective(SourceLocation Loc,
|
|
|
|
PragmaIntroducerKind Introducer) override;
|
|
|
|
void PragmaComment(SourceLocation Loc, const IdentifierInfo *Kind,
|
2015-06-02 04:00:20 +08:00
|
|
|
llvm::StringRef Str) override;
|
2019-03-24 15:21:32 +08:00
|
|
|
void PragmaDetectMismatch(SourceLocation Loc, llvm::StringRef Name,
|
2015-06-02 04:00:20 +08:00
|
|
|
llvm::StringRef Value) override;
|
2019-03-24 15:21:32 +08:00
|
|
|
void PragmaDebug(SourceLocation Loc, llvm::StringRef DebugType) override;
|
|
|
|
void PragmaMessage(SourceLocation Loc, llvm::StringRef Namespace,
|
|
|
|
PPCallbacks::PragmaMessageKind Kind,
|
2014-03-02 18:20:11 +08:00
|
|
|
llvm::StringRef Str) override;
|
2019-03-24 15:21:32 +08:00
|
|
|
void PragmaDiagnosticPush(SourceLocation Loc,
|
2014-03-02 18:20:11 +08:00
|
|
|
llvm::StringRef Namespace) override;
|
2019-03-24 15:21:32 +08:00
|
|
|
void PragmaDiagnosticPop(SourceLocation Loc,
|
2014-03-02 18:20:11 +08:00
|
|
|
llvm::StringRef Namespace) override;
|
2019-03-24 15:21:32 +08:00
|
|
|
void PragmaDiagnostic(SourceLocation Loc, llvm::StringRef Namespace,
|
|
|
|
diag::Severity mapping, llvm::StringRef Str) override;
|
|
|
|
void PragmaOpenCLExtension(SourceLocation NameLoc, const IdentifierInfo *Name,
|
|
|
|
SourceLocation StateLoc, unsigned State) override;
|
|
|
|
void PragmaWarning(SourceLocation Loc, llvm::StringRef WarningSpec,
|
2014-03-02 18:20:11 +08:00
|
|
|
llvm::ArrayRef<int> Ids) override;
|
2019-03-24 15:21:32 +08:00
|
|
|
void PragmaWarningPush(SourceLocation Loc, int Level) override;
|
|
|
|
void PragmaWarningPop(SourceLocation Loc) override;
|
|
|
|
void PragmaExecCharsetPush(SourceLocation Loc, StringRef Str) override;
|
|
|
|
void PragmaExecCharsetPop(SourceLocation Loc) override;
|
|
|
|
void MacroExpands(const Token &MacroNameTok, const MacroDefinition &MD,
|
|
|
|
SourceRange Range, const MacroArgs *Args) override;
|
|
|
|
void MacroDefined(const Token &MacroNameTok,
|
|
|
|
const MacroDirective *MD) override;
|
|
|
|
void MacroUndefined(const Token &MacroNameTok, const MacroDefinition &MD,
|
|
|
|
const MacroDirective *Undef) override;
|
|
|
|
void Defined(const Token &MacroNameTok, const MacroDefinition &MD,
|
|
|
|
SourceRange Range) override;
|
|
|
|
void SourceRangeSkipped(SourceRange Range, SourceLocation EndifLoc) override;
|
|
|
|
void If(SourceLocation Loc, SourceRange ConditionRange,
|
2014-03-02 18:20:11 +08:00
|
|
|
ConditionValueKind ConditionValue) override;
|
2019-03-24 15:21:32 +08:00
|
|
|
void Elif(SourceLocation Loc, SourceRange ConditionRange,
|
|
|
|
ConditionValueKind ConditionValue, SourceLocation IfLoc) override;
|
|
|
|
void Ifdef(SourceLocation Loc, const Token &MacroNameTok,
|
|
|
|
const MacroDefinition &MD) override;
|
|
|
|
void Ifndef(SourceLocation Loc, const Token &MacroNameTok,
|
|
|
|
const MacroDefinition &MD) override;
|
|
|
|
void Else(SourceLocation Loc, SourceLocation IfLoc) override;
|
|
|
|
void Endif(SourceLocation Loc, SourceLocation IfLoc) override;
|
2013-10-31 20:23:32 +08:00
|
|
|
|
|
|
|
// Helper functions.
|
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Start a new callback.
|
2013-10-31 20:23:32 +08:00
|
|
|
void beginCallback(const char *Name);
|
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a string to the top trace item.
|
2013-10-31 20:23:32 +08:00
|
|
|
void append(const char *Str);
|
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a bool argument to the top trace item.
|
2013-10-31 20:23:32 +08:00
|
|
|
void appendArgument(const char *Name, bool Value);
|
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append an int argument to the top trace item.
|
2013-10-31 20:23:32 +08:00
|
|
|
void appendArgument(const char *Name, int Value);
|
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a string argument to the top trace item.
|
2013-10-31 20:23:32 +08:00
|
|
|
void appendArgument(const char *Name, const char *Value);
|
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a string reference object argument to the top trace item.
|
2013-10-31 20:23:32 +08:00
|
|
|
void appendArgument(const char *Name, llvm::StringRef Value);
|
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a string object argument to the top trace item.
|
2013-10-31 20:23:32 +08:00
|
|
|
void appendArgument(const char *Name, const std::string &Value);
|
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a token argument to the top trace item.
|
2019-03-24 15:21:32 +08:00
|
|
|
void appendArgument(const char *Name, const Token &Value);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append an enum argument to the top trace item.
|
2015-10-18 13:14:41 +08:00
|
|
|
void appendArgument(const char *Name, int Value, const char *const Strings[]);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a FileID argument to the top trace item.
|
2019-03-24 15:21:32 +08:00
|
|
|
void appendArgument(const char *Name, FileID Value);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a FileEntry argument to the top trace item.
|
2019-03-24 15:21:32 +08:00
|
|
|
void appendArgument(const char *Name, const FileEntry *Value);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a SourceLocation argument to the top trace item.
|
2019-03-24 15:21:32 +08:00
|
|
|
void appendArgument(const char *Name, SourceLocation Value);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a SourceRange argument to the top trace item.
|
2019-03-24 15:21:32 +08:00
|
|
|
void appendArgument(const char *Name, SourceRange Value);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a CharSourceRange argument to the top trace item.
|
2019-03-24 15:21:32 +08:00
|
|
|
void appendArgument(const char *Name, CharSourceRange Value);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a ModuleIdPath argument to the top trace item.
|
2019-03-24 15:21:32 +08:00
|
|
|
void appendArgument(const char *Name, ModuleIdPath Value);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append an IdentifierInfo argument to the top trace item.
|
2019-03-24 15:21:32 +08:00
|
|
|
void appendArgument(const char *Name, const IdentifierInfo *Value);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a MacroDirective argument to the top trace item.
|
2019-03-24 15:21:32 +08:00
|
|
|
void appendArgument(const char *Name, const MacroDirective *Value);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a MacroDefinition argument to the top trace item.
|
2019-03-24 15:21:32 +08:00
|
|
|
void appendArgument(const char *Name, const MacroDefinition &Value);
|
2015-05-04 11:15:55 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a MacroArgs argument to the top trace item.
|
2019-03-24 15:21:32 +08:00
|
|
|
void appendArgument(const char *Name, const MacroArgs *Value);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a Module argument to the top trace item.
|
2019-03-24 15:21:32 +08:00
|
|
|
void appendArgument(const char *Name, const Module *Value);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a double-quoted argument to the top trace item.
|
2015-07-03 17:30:33 +08:00
|
|
|
void appendQuotedArgument(const char *Name, const std::string &Value);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Append a double-quoted file path argument to the top trace item.
|
2013-10-31 20:23:32 +08:00
|
|
|
void appendFilePathArgument(const char *Name, llvm::StringRef Value);
|
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Get the raw source string of the range.
|
2019-03-24 15:21:32 +08:00
|
|
|
llvm::StringRef getSourceString(CharSourceRange Range);
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Callback trace information.
|
2013-10-31 20:23:32 +08:00
|
|
|
/// We use a reference so the trace will be preserved for the caller
|
|
|
|
/// after this object is destructed.
|
|
|
|
std::vector<CallbackCall> &CallbackCalls;
|
|
|
|
|
[pp-trace] Delete -ignore and add a new option -callbacks
Summary:
-ignore specifies a list of PP callbacks to ignore. It cannot express a
whitelist, which may be more useful than a blacklist.
Add a new option -callbacks to replace it.
-ignore= (default) => -callbacks='*' (default)
-ignore=FileChanged,FileSkipped => -callbacks='*,-FileChanged,-FileSkipped'
-callbacks='Macro*' : print only MacroDefined,MacroExpands,MacroUndefined,...
Reviewers: juliehockett, aaron.ballman, alexfh, ioeric
Reviewed By: aaron.ballman
Subscribers: nemanjai, kbarton, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59296
llvm-svn: 356366
2019-03-18 21:30:17 +08:00
|
|
|
// List of (Glob,Enabled) pairs used to filter callbacks.
|
|
|
|
const FilterType &Filters;
|
|
|
|
|
|
|
|
// Whether a callback should be printed.
|
|
|
|
llvm::StringMap<bool> CallbackIsEnabled;
|
2013-10-31 20:23:32 +08:00
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 19:32:57 +08:00
|
|
|
/// Inhibit trace while this is set.
|
2013-10-31 20:23:32 +08:00
|
|
|
bool DisableTrace;
|
|
|
|
|
2019-03-24 15:21:32 +08:00
|
|
|
Preprocessor &PP;
|
2013-10-31 20:23:32 +08:00
|
|
|
};
|
|
|
|
|
2019-03-24 15:21:32 +08:00
|
|
|
} // namespace pp_trace
|
|
|
|
} // namespace clang
|
|
|
|
|
2013-10-31 20:23:32 +08:00
|
|
|
#endif // PPTRACE_PPCALLBACKSTRACKER_H
|