From 4cad5fab78ab75705f33f56dd3524ff9ca327612 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Wed, 6 Nov 2019 14:43:22 +0300 Subject: [PATCH] [HIPIFY][format] Apply clang style formatting in LLVMCompat --- hipamd/hipify-clang/src/LLVMCompat.cpp | 16 ++++++++-------- hipamd/hipify-clang/src/LLVMCompat.h | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/hipamd/hipify-clang/src/LLVMCompat.cpp b/hipamd/hipify-clang/src/LLVMCompat.cpp index 1d1119f206..b5aea95dca 100644 --- a/hipamd/hipify-clang/src/LLVMCompat.cpp +++ b/hipamd/hipify-clang/src/LLVMCompat.cpp @@ -40,7 +40,7 @@ void PrintStackTraceOnErrorSignal() { #endif } -ct::Replacements& getReplacements(ct::RefactoringTool& Tool, StringRef file) { +ct::Replacements &getReplacements(ct::RefactoringTool &Tool, StringRef file) { #if LLVM_VERSION_MAJOR > 3 // getReplacements() now returns a map from filename to Replacements - so create an entry // for this source file and return a reference to it. @@ -50,7 +50,7 @@ ct::Replacements& getReplacements(ct::RefactoringTool& Tool, StringRef file) { #endif } -void insertReplacement(ct::Replacements& replacements, const ct::Replacement& rep) { +void insertReplacement(ct::Replacements &replacements, const ct::Replacement &rep) { #if LLVM_VERSION_MAJOR > 3 // New clang added error checking to Replacements, and *insists* that you explicitly check it. llvm::consumeError(replacements.add(rep)); @@ -60,7 +60,7 @@ void insertReplacement(ct::Replacements& replacements, const ct::Replacement& re #endif } -void EnterPreprocessorTokenStream(clang::Preprocessor& _pp, const clang::Token *start, size_t len, bool DisableMacroExpansion) { +void EnterPreprocessorTokenStream(clang::Preprocessor &_pp, const clang::Token *start, size_t len, bool DisableMacroExpansion) { #if (LLVM_VERSION_MAJOR == 3) && (LLVM_VERSION_MINOR == 8) _pp.EnterTokenStream(start, len, false, DisableMacroExpansion); #else @@ -72,7 +72,7 @@ void EnterPreprocessorTokenStream(clang::Preprocessor& _pp, const clang::Token * #endif } -clang::SourceLocation getBeginLoc(const clang::Stmt* stmt) { +clang::SourceLocation getBeginLoc(const clang::Stmt *stmt) { #if LLVM_VERSION_MAJOR < 8 return stmt->getLocStart(); #else @@ -80,7 +80,7 @@ clang::SourceLocation getBeginLoc(const clang::Stmt* stmt) { #endif } -clang::SourceLocation getBeginLoc(const clang::TypeLoc& typeLoc) { +clang::SourceLocation getBeginLoc(const clang::TypeLoc &typeLoc) { #if LLVM_VERSION_MAJOR < 8 return typeLoc.getLocStart(); #else @@ -88,7 +88,7 @@ clang::SourceLocation getBeginLoc(const clang::TypeLoc& typeLoc) { #endif } -clang::SourceLocation getEndLoc(const clang::Stmt* stmt) { +clang::SourceLocation getEndLoc(const clang::Stmt *stmt) { #if LLVM_VERSION_MAJOR < 8 return stmt->getLocEnd(); #else @@ -96,7 +96,7 @@ clang::SourceLocation getEndLoc(const clang::Stmt* stmt) { #endif } -clang::SourceLocation getEndLoc(const clang::TypeLoc& typeLoc) { +clang::SourceLocation getEndLoc(const clang::TypeLoc &typeLoc) { #if LLVM_VERSION_MAJOR < 8 return typeLoc.getLocEnd(); #else @@ -151,7 +151,7 @@ bool CheckCompatibility() { return true; } -clang::SourceLocation getEndOfExpansionRangeForLoc(const clang::SourceManager& SM, const clang::SourceLocation& loc) { +clang::SourceLocation getEndOfExpansionRangeForLoc(const clang::SourceManager &SM, const clang::SourceLocation &loc) { #if LLVM_VERSION_MAJOR > 6 return SM.getExpansionRange(loc).getEnd(); #else diff --git a/hipamd/hipify-clang/src/LLVMCompat.h b/hipamd/hipify-clang/src/LLVMCompat.h index 8ad2862d9f..e857023752 100644 --- a/hipamd/hipify-clang/src/LLVMCompat.h +++ b/hipamd/hipify-clang/src/LLVMCompat.h @@ -49,11 +49,11 @@ namespace llcompat { #define LLVM_DEBUG(X) DEBUG(X) #endif -clang::SourceLocation getBeginLoc(const clang::Stmt* stmt); -clang::SourceLocation getBeginLoc(const clang::TypeLoc& typeLoc); +clang::SourceLocation getBeginLoc(const clang::Stmt *stmt); +clang::SourceLocation getBeginLoc(const clang::TypeLoc &typeLoc); -clang::SourceLocation getEndLoc(const clang::Stmt* stmt); -clang::SourceLocation getEndLoc(const clang::TypeLoc& typeLoc); +clang::SourceLocation getEndLoc(const clang::Stmt *stmt); +clang::SourceLocation getEndLoc(const clang::TypeLoc &typeLoc); void PrintStackTraceOnErrorSignal(); @@ -65,17 +65,17 @@ using namespace llvm; * Older LLVM versions don't actually support multiple filenames, so everything all gets * smushed together. It is the caller's responsibility to cope with this. */ -ct::Replacements& getReplacements(ct::RefactoringTool& Tool, StringRef file); +ct::Replacements &getReplacements(ct::RefactoringTool &Tool, StringRef file); /** * Add a Replacement to a Replacements. */ -void insertReplacement(ct::Replacements& replacements, const ct::Replacement& rep); +void insertReplacement(ct::Replacements &replacements, const ct::Replacement &rep); /** * Version-agnostic version of Preprocessor::EnterTokenStream(). */ -void EnterPreprocessorTokenStream(clang::Preprocessor& _pp, +void EnterPreprocessorTokenStream(clang::Preprocessor &_pp, const clang::Token *start, size_t len, bool DisableMacroExpansion); @@ -91,6 +91,6 @@ void RetainExcludedConditionalBlocks(clang::CompilerInstance &CI); bool CheckCompatibility(); -clang::SourceLocation getEndOfExpansionRangeForLoc(const clang::SourceManager& SM, const clang::SourceLocation& loc); +clang::SourceLocation getEndOfExpansionRangeForLoc(const clang::SourceManager &SM, const clang::SourceLocation &loc); } // namespace llcompat