From bc26e77ab21231690794db8138e888ddd923d395 Mon Sep 17 00:00:00 2001
From: Joao Matos <joao@tritao.eu>
Date: Fri, 15 Apr 2016 00:28:01 +0100
Subject: [PATCH] Extract AST->getTargetInfo() expression into a local
 variable.

---
 src/CppParser/Parser.cpp | 83 ++++++++++++++++++++--------------------
 1 file changed, 42 insertions(+), 41 deletions(-)

diff --git a/src/CppParser/Parser.cpp b/src/CppParser/Parser.cpp
index b9bdb8fe..3310a2bc 100644
--- a/src/CppParser/Parser.cpp
+++ b/src/CppParser/Parser.cpp
@@ -3521,47 +3521,48 @@ ParserTargetInfo* Parser::GetTargetInfo()
 
     auto parserTargetInfo = new ParserTargetInfo();
 
-    parserTargetInfo->ABI = AST->getTargetInfo().getABI();
-
-    parserTargetInfo->Char16Type = ConvertIntType(AST->getTargetInfo().getChar16Type());
-    parserTargetInfo->Char32Type = ConvertIntType(AST->getTargetInfo().getChar32Type());
-    parserTargetInfo->Int64Type = ConvertIntType(AST->getTargetInfo().getInt64Type());
-    parserTargetInfo->IntMaxType = ConvertIntType(AST->getTargetInfo().getIntMaxType());
-    parserTargetInfo->IntPtrType = ConvertIntType(AST->getTargetInfo().getIntPtrType());
-    parserTargetInfo->SizeType = ConvertIntType(AST->getTargetInfo().getSizeType());
-    parserTargetInfo->UIntMaxType = ConvertIntType(AST->getTargetInfo().getUIntMaxType());
-    parserTargetInfo->WCharType = ConvertIntType(AST->getTargetInfo().getWCharType());
-    parserTargetInfo->WIntType = ConvertIntType(AST->getTargetInfo().getWIntType());
-
-    parserTargetInfo->BoolAlign = AST->getTargetInfo().getBoolAlign();
-    parserTargetInfo->BoolWidth = AST->getTargetInfo().getBoolWidth();
-    parserTargetInfo->CharAlign = AST->getTargetInfo().getCharAlign();
-    parserTargetInfo->CharWidth = AST->getTargetInfo().getCharWidth();
-    parserTargetInfo->Char16Align = AST->getTargetInfo().getChar16Align();
-    parserTargetInfo->Char16Width = AST->getTargetInfo().getChar16Width();
-    parserTargetInfo->Char32Align = AST->getTargetInfo().getChar32Align();
-    parserTargetInfo->Char32Width = AST->getTargetInfo().getChar32Width();
-    parserTargetInfo->HalfAlign = AST->getTargetInfo().getHalfAlign();
-    parserTargetInfo->HalfWidth = AST->getTargetInfo().getHalfWidth();
-    parserTargetInfo->FloatAlign = AST->getTargetInfo().getFloatAlign();
-    parserTargetInfo->FloatWidth = AST->getTargetInfo().getFloatWidth();
-    parserTargetInfo->DoubleAlign = AST->getTargetInfo().getDoubleAlign();
-    parserTargetInfo->DoubleWidth = AST->getTargetInfo().getDoubleWidth();
-    parserTargetInfo->ShortAlign = AST->getTargetInfo().getShortAlign();
-    parserTargetInfo->ShortWidth = AST->getTargetInfo().getShortWidth();
-    parserTargetInfo->IntAlign = AST->getTargetInfo().getIntAlign();
-    parserTargetInfo->IntWidth = AST->getTargetInfo().getIntWidth();
-    parserTargetInfo->IntMaxTWidth = AST->getTargetInfo().getIntMaxTWidth();
-    parserTargetInfo->LongAlign = AST->getTargetInfo().getLongAlign();
-    parserTargetInfo->LongWidth = AST->getTargetInfo().getLongWidth();
-    parserTargetInfo->LongDoubleAlign = AST->getTargetInfo().getLongDoubleAlign();
-    parserTargetInfo->LongDoubleWidth = AST->getTargetInfo().getLongDoubleWidth();
-    parserTargetInfo->LongLongAlign = AST->getTargetInfo().getLongLongAlign();
-    parserTargetInfo->LongLongWidth = AST->getTargetInfo().getLongLongWidth();
-    parserTargetInfo->PointerAlign = AST->getTargetInfo().getPointerAlign(0);
-    parserTargetInfo->PointerWidth = AST->getTargetInfo().getPointerWidth(0);
-    parserTargetInfo->WCharAlign = AST->getTargetInfo().getWCharAlign();
-    parserTargetInfo->WCharWidth = AST->getTargetInfo().getWCharWidth();
+    auto& TI = AST->getTargetInfo();
+    parserTargetInfo->ABI = TI.getABI();
+
+    parserTargetInfo->Char16Type = ConvertIntType(TI.getChar16Type());
+    parserTargetInfo->Char32Type = ConvertIntType(TI.getChar32Type());
+    parserTargetInfo->Int64Type = ConvertIntType(TI.getInt64Type());
+    parserTargetInfo->IntMaxType = ConvertIntType(TI.getIntMaxType());
+    parserTargetInfo->IntPtrType = ConvertIntType(TI.getIntPtrType());
+    parserTargetInfo->SizeType = ConvertIntType(TI.getSizeType());
+    parserTargetInfo->UIntMaxType = ConvertIntType(TI.getUIntMaxType());
+    parserTargetInfo->WCharType = ConvertIntType(TI.getWCharType());
+    parserTargetInfo->WIntType = ConvertIntType(TI.getWIntType());
+
+    parserTargetInfo->BoolAlign = TI.getBoolAlign();
+    parserTargetInfo->BoolWidth = TI.getBoolWidth();
+    parserTargetInfo->CharAlign = TI.getCharAlign();
+    parserTargetInfo->CharWidth = TI.getCharWidth();
+    parserTargetInfo->Char16Align = TI.getChar16Align();
+    parserTargetInfo->Char16Width = TI.getChar16Width();
+    parserTargetInfo->Char32Align = TI.getChar32Align();
+    parserTargetInfo->Char32Width = TI.getChar32Width();
+    parserTargetInfo->HalfAlign = TI.getHalfAlign();
+    parserTargetInfo->HalfWidth = TI.getHalfWidth();
+    parserTargetInfo->FloatAlign = TI.getFloatAlign();
+    parserTargetInfo->FloatWidth = TI.getFloatWidth();
+    parserTargetInfo->DoubleAlign = TI.getDoubleAlign();
+    parserTargetInfo->DoubleWidth = TI.getDoubleWidth();
+    parserTargetInfo->ShortAlign = TI.getShortAlign();
+    parserTargetInfo->ShortWidth = TI.getShortWidth();
+    parserTargetInfo->IntAlign = TI.getIntAlign();
+    parserTargetInfo->IntWidth = TI.getIntWidth();
+    parserTargetInfo->IntMaxTWidth = TI.getIntMaxTWidth();
+    parserTargetInfo->LongAlign = TI.getLongAlign();
+    parserTargetInfo->LongWidth = TI.getLongWidth();
+    parserTargetInfo->LongDoubleAlign = TI.getLongDoubleAlign();
+    parserTargetInfo->LongDoubleWidth = TI.getLongDoubleWidth();
+    parserTargetInfo->LongLongAlign = TI.getLongLongAlign();
+    parserTargetInfo->LongLongWidth = TI.getLongLongWidth();
+    parserTargetInfo->PointerAlign = TI.getPointerAlign(0);
+    parserTargetInfo->PointerWidth = TI.getPointerWidth(0);
+    parserTargetInfo->WCharAlign = TI.getWCharAlign();
+    parserTargetInfo->WCharWidth = TI.getWCharWidth();
 
     return parserTargetInfo;
 }