summaryrefslogtreecommitdiffstats
path: root/pp-trace
diff options
context:
space:
mode:
authorJohn Thompson <John.Thompson.JTSoftware@gmail.com>2013-12-07 08:41:15 +0000
committerJohn Thompson <John.Thompson.JTSoftware@gmail.com>2013-12-07 08:41:15 +0000
commitf3291f7aebac4fb1ce982005314d0d17418097f5 (patch)
treed48e0b37a8b4aff3c911b115e94fef1a719e0790 /pp-trace
parentda7c810312a78e2e54c089dbc6b7566b3a0978ac (diff)
Changed ConditionValue argument to PPCallbacks If and Elif callbacks to be a 3-state enum.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@196648 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'pp-trace')
-rw-r--r--pp-trace/PPCallbacksTracker.cpp14
-rw-r--r--pp-trace/PPCallbacksTracker.h4
2 files changed, 12 insertions, 6 deletions
diff --git a/pp-trace/PPCallbacksTracker.cpp b/pp-trace/PPCallbacksTracker.cpp
index c0244184..55c757d6 100644
--- a/pp-trace/PPCallbacksTracker.cpp
+++ b/pp-trace/PPCallbacksTracker.cpp
@@ -77,6 +77,12 @@ static const char *PragmaIntroducerKindStrings[] = { "PIK_HashPragma",
static const char *PragmaMessageKindStrings[] = { "PMK_Message", "PMK_Warning",
"PMK_Error" };
+// ConditionValueKind strings.
+const char *
+ConditionValueKindStrings[] = {
+ "CVK_NotEvaluated", "CVK_False", "CVK_True"
+};
+
// Mapping strings.
static const char *MappingStrings[] = { "0", "MAP_IGNORE",
"MAP_WARNING", "MAP_ERROR",
@@ -345,22 +351,22 @@ void PPCallbacksTracker::SourceRangeSkipped(clang::SourceRange Range) {
// Hook called whenever an #if is seen.
void PPCallbacksTracker::If(clang::SourceLocation Loc,
clang::SourceRange ConditionRange,
- bool ConditionValue) {
+ ConditionValueKind ConditionValue) {
beginCallback("If");
appendArgument("Loc", Loc);
appendArgument("ConditionRange", ConditionRange);
- appendArgument("ConditionValue", ConditionValue);
+ appendArgument("ConditionValue", ConditionValue, ConditionValueKindStrings);
}
// Hook called whenever an #elif is seen.
void PPCallbacksTracker::Elif(clang::SourceLocation Loc,
clang::SourceRange ConditionRange,
- bool ConditionValue,
+ ConditionValueKind ConditionValue,
clang::SourceLocation IfLoc) {
beginCallback("Elif");
appendArgument("Loc", Loc);
appendArgument("ConditionRange", ConditionRange);
- appendArgument("ConditionValue", ConditionValue);
+ appendArgument("ConditionValue", ConditionValue, ConditionValueKindStrings);
appendArgument("IfLoc", IfLoc);
}
diff --git a/pp-trace/PPCallbacksTracker.h b/pp-trace/PPCallbacksTracker.h
index 73934eda..29c6fede 100644
--- a/pp-trace/PPCallbacksTracker.h
+++ b/pp-trace/PPCallbacksTracker.h
@@ -140,9 +140,9 @@ public:
clang::SourceRange Range) LLVM_OVERRIDE;
void SourceRangeSkipped(clang::SourceRange Range) LLVM_OVERRIDE;
void If(clang::SourceLocation Loc, clang::SourceRange ConditionRange,
- bool ConditionValue) LLVM_OVERRIDE;
+ ConditionValueKind ConditionValue) LLVM_OVERRIDE;
void Elif(clang::SourceLocation Loc, clang::SourceRange ConditionRange,
- bool ConditionValue, clang::SourceLocation IfLoc) LLVM_OVERRIDE;
+ ConditionValueKind ConditionValue, clang::SourceLocation IfLoc) LLVM_OVERRIDE;
void Ifdef(clang::SourceLocation Loc, const clang::Token &MacroNameTok,
const clang::MacroDirective *MD) LLVM_OVERRIDE;
void Ifndef(clang::SourceLocation Loc, const clang::Token &MacroNameTok,