forked from qt-creator/qt-creator
Clang: Require LLVM/Clang >= 5.0.0
...for the code model parts and declare 5.0 as the supported version for the clang static analyzer. Adapt versions and tests, remove code assuming clang <= 5.0. LLVM/Clang 5 was released on 07 Sep 2017. Task-number: QTCREATORBUG-18931 Task-number: QTCREATORBUG-18657 Task-number: QTCREATORBUG-17187 Task-number: QTCREATORBUG-14881 Change-Id: I53b00258ca06a1d2e57f9379dacc54b310687295 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -132,7 +132,7 @@ ClangQueryDiagnosticErrorType convertToErrorType(Diagnostics::ErrorType clangErr
|
||||
ERROR_RETURN_CASE(ParserInvalidToken)
|
||||
ERROR_RETURN_CASE(ParserMalformedBindExpr)
|
||||
ERROR_RETURN_CASE(ParserTrailingCode)
|
||||
ERROR_RETURN_CASE(ParserUnsignedError)
|
||||
ERROR_RETURN_CASE(ParserNumberError)
|
||||
ERROR_RETURN_CASE(ParserOverloadedType)
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ LocationSourceFileCallbacks::LocationSourceFileCallbacks(uint line,
|
||||
{
|
||||
}
|
||||
|
||||
bool LocationSourceFileCallbacks::handleBeginSource(clang::CompilerInstance &compilerInstance, llvm::StringRef /*fileName*/)
|
||||
bool LocationSourceFileCallbacks::handleBeginSource(clang::CompilerInstance &compilerInstance)
|
||||
{
|
||||
auto &preprocessor = compilerInstance.getPreprocessor();
|
||||
|
||||
|
||||
@@ -48,8 +48,7 @@ class LocationSourceFileCallbacks : public clang::tooling::SourceFileCallbacks
|
||||
public:
|
||||
LocationSourceFileCallbacks(uint line, uint column, FilePathCachingInterface &filePathCache);
|
||||
|
||||
bool handleBeginSource(clang::CompilerInstance &compilerInstance,
|
||||
llvm::StringRef fileName) override;
|
||||
bool handleBeginSource(clang::CompilerInstance &compilerInstance) override;
|
||||
|
||||
SourceLocationsContainer takeSourceLocations();
|
||||
Utils::SmallString takeSymbolName();
|
||||
|
||||
@@ -82,11 +82,8 @@ void RefactoringCompilationDatabase::addFile(const std::string &directory,
|
||||
const std::string &fileName,
|
||||
const std::vector<std::string> &commandLine)
|
||||
{
|
||||
#if LLVM_VERSION_MAJOR >= 4
|
||||
compileCommands.emplace_back(directory, fileName, commandLine, std::string());
|
||||
#else
|
||||
compileCommands.emplace_back(directory, fileName, commandLine);
|
||||
#endif
|
||||
|
||||
compileCommands.emplace_back(directory, fileName, commandLine, llvm::StringRef());
|
||||
}
|
||||
|
||||
} // namespace ClangBackEnd
|
||||
|
||||
@@ -42,9 +42,11 @@ namespace ClangBackEnd {
|
||||
inline
|
||||
llvm::SmallString<256> absolutePath(clang::StringRef path)
|
||||
{
|
||||
llvm::SmallString<256> absolutePath(path);
|
||||
llvm::SmallString<256> absolutePath;
|
||||
|
||||
if (!llvm::sys::path::is_absolute(absolutePath))
|
||||
std::error_code errorCode = llvm::sys::fs::real_path(path, absolutePath, true);
|
||||
|
||||
if (!errorCode && !llvm::sys::path::is_absolute(absolutePath))
|
||||
llvm::sys::fs::make_absolute(absolutePath);
|
||||
|
||||
return absolutePath;
|
||||
|
||||
Reference in New Issue
Block a user