From 3d17066e0cb308fdb53fdcb50f3e46a8224188a0 Mon Sep 17 00:00:00 2001 From: Mike Lischke Date: Wed, 6 Apr 2016 15:12:47 +0200 Subject: [PATCH] Removed a few unnecessary pointer casts. --- runtime/Cpp/runtime/atn/LL1Analyzer.cpp | 2 +- runtime/Cpp/runtime/atn/LexerATNSimulator.cpp | 4 ++-- runtime/Cpp/runtime/atn/ParserATNSimulator.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/Cpp/runtime/atn/LL1Analyzer.cpp b/runtime/Cpp/runtime/atn/LL1Analyzer.cpp index 2e6966566..354eb94dc 100755 --- a/runtime/Cpp/runtime/atn/LL1Analyzer.cpp +++ b/runtime/Cpp/runtime/atn/LL1Analyzer.cpp @@ -61,7 +61,7 @@ std::vector LL1Analyzer::getDecisionLookahead(ATNState *s) co std::set lookBusy; antlrcpp::BitSet callRuleStack; - _LOOK(s->transition(alt)->target, nullptr, std::dynamic_pointer_cast(PredictionContext::EMPTY), + _LOOK(s->transition(alt)->target, nullptr, PredictionContext::EMPTY, look[alt], lookBusy, callRuleStack, seeThruPreds, false); // Wipe out lookahead for this alternative if we found nothing diff --git a/runtime/Cpp/runtime/atn/LexerATNSimulator.cpp b/runtime/Cpp/runtime/atn/LexerATNSimulator.cpp index 6c2c9d847..df8782c8e 100755 --- a/runtime/Cpp/runtime/atn/LexerATNSimulator.cpp +++ b/runtime/Cpp/runtime/atn/LexerATNSimulator.cpp @@ -316,7 +316,7 @@ atn::ATNConfigSet *LexerATNSimulator::computeStartState(CharStream *input, ATNSt ATNConfigSet *configs = new OrderedATNConfigSet(); for (size_t i = 0; i < p->getNumberOfTransitions(); i++) { ATNState *target = p->transition(i)->target; - LexerATNConfig *c = new LexerATNConfig(target, (int)(i + 1), std::dynamic_pointer_cast(initialContext)); + LexerATNConfig *c = new LexerATNConfig(target, (int)(i + 1), initialContext); closure(input, c, configs, false, false); } return configs; @@ -342,7 +342,7 @@ bool LexerATNSimulator::closure(CharStream *input, LexerATNConfig *config, ATNCo configs->add(config); return true; } else { - configs->add(new LexerATNConfig(config, config->state, std::dynamic_pointer_cast(PredictionContext::EMPTY))); + configs->add(new LexerATNConfig(config, config->state, PredictionContext::EMPTY)); currentAltReachedAcceptState = true; } } diff --git a/runtime/Cpp/runtime/atn/ParserATNSimulator.cpp b/runtime/Cpp/runtime/atn/ParserATNSimulator.cpp index 90eb09e67..d1bedc1e4 100755 --- a/runtime/Cpp/runtime/atn/ParserATNSimulator.cpp +++ b/runtime/Cpp/runtime/atn/ParserATNSimulator.cpp @@ -882,7 +882,7 @@ atn::ATNConfig *ParserATNSimulator::precedenceTransition(ATNConfig *config, Prec } } else { std::shared_ptr newSemCtx = std::make_shared(config->semanticContext, predicate); - c = new ATNConfig(config, pt->target, std::dynamic_pointer_cast(newSemCtx)); + c = new ATNConfig(config, pt->target, newSemCtx); } } else { c = new ATNConfig(config, pt->target); @@ -919,7 +919,7 @@ atn::ATNConfig *ParserATNSimulator::predTransition(ATNConfig *config, PredicateT } } else { std::shared_ptr newSemCtx = std::make_shared(config->semanticContext, predicate); - c = new ATNConfig(config, pt->target, std::dynamic_pointer_cast(newSemCtx)); + c = new ATNConfig(config, pt->target, newSemCtx); } } else { c = new ATNConfig(config, pt->target);