-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: API boosting support for using decls and enum constants. (#9418)
Via AST node matchers on UsingDecl and DeclRefExpr. This commit also refactors the clang::tooling::SourceFileCallbacks run() routine, by moving to a per AST node dispatch model. This will support scaling to additional AST node types in the future without having run() grow to an unreadable length. Risk level: Low Testing: Additional golden tests. Part of #8082. Signed-off-by: Harvey Tuch <htuch@google.com>
- Loading branch information
Showing
8 changed files
with
284 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "envoy/config/overload/v2alpha/overload.pb.h" | ||
|
||
using envoy::config::overload::v2alpha::Trigger; | ||
|
||
class ThresholdTriggerImpl { | ||
public: | ||
ThresholdTriggerImpl(const envoy::config::overload::v2alpha::Trigger& config) { | ||
switch (config.trigger_oneof_case()) { | ||
case envoy::config::overload::v2alpha::Trigger::kThreshold: | ||
break; | ||
default: | ||
break; | ||
} | ||
switch (config.trigger_oneof_case()) { | ||
case Trigger::kThreshold: | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "envoy/config/overload/v3alpha/overload.pb.h" | ||
|
||
using envoy::config::overload::v3alpha::Trigger; | ||
|
||
class ThresholdTriggerImpl { | ||
public: | ||
ThresholdTriggerImpl(const envoy::config::overload::v3alpha::Trigger& config) { | ||
switch (config.trigger_oneof_case()) { | ||
case envoy::config::overload::v3alpha::Trigger::kThreshold: | ||
break; | ||
default: | ||
break; | ||
} | ||
switch (config.trigger_oneof_case()) { | ||
case Trigger::kThreshold: | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "envoy/config/overload/v2alpha/overload.pb.h" | ||
|
||
using envoy::config::overload::v2alpha::ThresholdTrigger; | ||
using SomePtrAlias = std::unique_ptr<envoy::config::overload::v2alpha::ThresholdTrigger>; | ||
|
||
class ThresholdTriggerImpl { | ||
public: | ||
ThresholdTriggerImpl(const ThresholdTrigger& /*config*/) {} | ||
ThresholdTriggerImpl(SomePtrAlias /*config*/) {} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "envoy/config/overload/v3alpha/overload.pb.h" | ||
|
||
using envoy::config::overload::v3alpha::ThresholdTrigger; | ||
using SomePtrAlias = std::unique_ptr<envoy::config::overload::v3alpha::ThresholdTrigger>; | ||
|
||
class ThresholdTriggerImpl { | ||
public: | ||
ThresholdTriggerImpl(const ThresholdTrigger& /*config*/) {} | ||
ThresholdTriggerImpl(SomePtrAlias /*config*/) {} | ||
}; |
Oops, something went wrong.