Skip to content

Commit

Permalink
Compile with clang <= 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
tsdgeos committed Sep 22, 2015
1 parent 91a7756 commit edf2a3e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions checks/oldstyleconnect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ enum ConnectFlag {
};


#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 6
class PreprocessorCallbacks : public clang::PPCallbacks
{
public:
Expand Down Expand Up @@ -99,13 +100,16 @@ class PreprocessorCallbacks : public clang::PPCallbacks
SourceManager *m_sm;
LangOptions m_langOpts;
};
#endif

OldStyleConnect::OldStyleConnect(const std::string &name)
: CheckBase(name)
{
#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 6
m_preprocessorCallbacks = new PreprocessorCallbacks(this, &m_ci.getSourceManager(), m_ci.getLangOpts());
Preprocessor &pi = m_ci.getPreprocessor();
pi.addPPCallbacks(std::unique_ptr<PPCallbacks>(m_preprocessorCallbacks));
#endif
}

int OldStyleConnect::classifyConnect(FunctionDecl *connectFunc, CallExpr *connectCall)
Expand Down

0 comments on commit edf2a3e

Please sign in to comment.