clang/0002-Format-isInSystemMacro...

40 lines
1.4 KiB
Diff

From 49b29ff9feafd8b9041e2a76cbe843115d263ced Mon Sep 17 00:00:00 2001
From: Fangrui Song <maskray@google.com>
Date: Mon, 11 Feb 2019 13:30:04 +0000
Subject: [PATCH 2/3] Format isInSystemMacro after D55782
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353697 91177308-0d34-0410-b5e6-96231b3b80d8
---
include/clang/Basic/SourceManager.h | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index c6b92f9000..f44239d9ce 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -1459,17 +1459,15 @@ public:
/// Returns whether \p Loc is expanded from a macro in a system header.
bool isInSystemMacro(SourceLocation loc) const {
- if(!loc.isMacroID())
+ if (!loc.isMacroID())
return false;
// This happens when the macro is the result of a paste, in that case
// its spelling is the scratch memory, so we take the parent context.
- if (isWrittenInScratchSpace(getSpellingLoc(loc))) {
+ if (isWrittenInScratchSpace(getSpellingLoc(loc)))
return isInSystemHeader(getSpellingLoc(getImmediateMacroCallerLoc(loc)));
- }
- else {
- return isInSystemHeader(getSpellingLoc(loc));
- }
+
+ return isInSystemHeader(getSpellingLoc(loc));
}
/// The size of the SLocEntry that \p FID represents.
--
2.20.1