@@ -351,6 +351,22 @@ class PPCallbacks {
351
351
const MacroDefinition &MD) {
352
352
}
353
353
354
+ // / Hook called whenever an \#elifdef branch is taken.
355
+ // / \param Loc the source location of the directive.
356
+ // / \param MacroNameTok Information on the token being tested.
357
+ // / \param MD The MacroDefinition if the name was a macro, null otherwise.
358
+ virtual void Elifdef (SourceLocation Loc, const Token &MacroNameTok,
359
+ const MacroDefinition &MD) {
360
+ }
361
+ // / Hook called whenever an \#elifdef is skipped.
362
+ // / \param Loc the source location of the directive.
363
+ // / \param ConditionRange The SourceRange of the expression being tested.
364
+ // / \param IfLoc the source location of the \#if/\#ifdef/\#ifndef directive.
365
+ // FIXME: better to pass in a list (or tree!) of Tokens.
366
+ virtual void Elifdef (SourceLocation Loc, SourceRange ConditionRange,
367
+ SourceLocation IfLoc) {
368
+ }
369
+
354
370
// / Hook called whenever an \#ifndef is seen.
355
371
// / \param Loc the source location of the directive.
356
372
// / \param MacroNameTok Information on the token being tested.
@@ -359,6 +375,22 @@ class PPCallbacks {
359
375
const MacroDefinition &MD) {
360
376
}
361
377
378
+ // / Hook called whenever an \#elifndef branch is taken.
379
+ // / \param Loc the source location of the directive.
380
+ // / \param MacroNameTok Information on the token being tested.
381
+ // / \param MD The MacroDefinition if the name was a macro, null otherwise.
382
+ virtual void Elifndef (SourceLocation Loc, const Token &MacroNameTok,
383
+ const MacroDefinition &MD) {
384
+ }
385
+ // / Hook called whenever an \#elifndef is skipped.
386
+ // / \param Loc the source location of the directive.
387
+ // / \param ConditionRange The SourceRange of the expression being tested.
388
+ // / \param IfLoc the source location of the \#if/\#ifdef/\#ifndef directive.
389
+ // FIXME: better to pass in a list (or tree!) of Tokens.
390
+ virtual void Elifndef (SourceLocation Loc, SourceRange ConditionRange,
391
+ SourceLocation IfLoc) {
392
+ }
393
+
362
394
// / Hook called whenever an \#else is seen.
363
395
// / \param Loc the source location of the directive.
364
396
// / \param IfLoc the source location of the \#if/\#ifdef/\#ifndef directive.
@@ -586,13 +618,39 @@ class PPChainedCallbacks : public PPCallbacks {
586
618
Second->Ifdef (Loc, MacroNameTok, MD);
587
619
}
588
620
621
+ // / Hook called whenever an \#elifdef is taken.
622
+ void Elifdef (SourceLocation Loc, const Token &MacroNameTok,
623
+ const MacroDefinition &MD) override {
624
+ First->Elifdef (Loc, MacroNameTok, MD);
625
+ Second->Elifdef (Loc, MacroNameTok, MD);
626
+ }
627
+ // / Hook called whenever an \#elifdef is skipped.
628
+ void Elifdef (SourceLocation Loc, SourceRange ConditionRange,
629
+ SourceLocation IfLoc) override {
630
+ First->Elifdef (Loc, ConditionRange, IfLoc);
631
+ Second->Elifdef (Loc, ConditionRange, IfLoc);
632
+ }
633
+
589
634
// / Hook called whenever an \#ifndef is seen.
590
635
void Ifndef (SourceLocation Loc, const Token &MacroNameTok,
591
636
const MacroDefinition &MD) override {
592
637
First->Ifndef (Loc, MacroNameTok, MD);
593
638
Second->Ifndef (Loc, MacroNameTok, MD);
594
639
}
595
640
641
+ // / Hook called whenever an \#elifndef is taken.
642
+ void Elifndef (SourceLocation Loc, const Token &MacroNameTok,
643
+ const MacroDefinition &MD) override {
644
+ First->Elifndef (Loc, MacroNameTok, MD);
645
+ Second->Elifndef (Loc, MacroNameTok, MD);
646
+ }
647
+ // / Hook called whenever an \#elifndef is skipped.
648
+ void Elifndef (SourceLocation Loc, SourceRange ConditionRange,
649
+ SourceLocation IfLoc) override {
650
+ First->Elifndef (Loc, ConditionRange, IfLoc);
651
+ Second->Elifndef (Loc, ConditionRange, IfLoc);
652
+ }
653
+
596
654
// / Hook called whenever an \#else is seen.
597
655
void Else (SourceLocation Loc, SourceLocation IfLoc) override {
598
656
First->Else (Loc, IfLoc);
0 commit comments