瀏覽代碼

Rename payload qualifier field to not match type (#3607)

Some compilers (gcc) get really unhappy when your field name matches the
type name. In the defense of such, it does make you wonder what sizeof()
would return if the member were not of its namesake's type.

Anyway, gcc should be able to build. This renames the member to differ
from the type to make all the Gnus happy.

(cherry picked from commit 220e884560f6092a8ea7e0f0d80db3db0e88da1a)
Greg Roth 4 年之前
父節點
當前提交
1a92a22613
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      tools/clang/lib/Sema/SemaDXR.cpp

+ 5 - 5
tools/clang/lib/Sema/SemaDXR.cpp

@@ -67,7 +67,7 @@ struct PayloadAccessInfo {
 };
 };
 
 
 struct DxrShaderDiagnoseInfo {
 struct DxrShaderDiagnoseInfo {
-  const FunctionDecl *FunctionDecl;
+  const FunctionDecl *funcDecl;
   const VarDecl *Payload;
   const VarDecl *Payload;
   DXIL::PayloadAccessShaderStage Stage;
   DXIL::PayloadAccessShaderStage Stage;
   std::vector<TraceRayCall> TraceCalls;
   std::vector<TraceRayCall> TraceCalls;
@@ -689,7 +689,7 @@ DiagnosePayloadAsFunctionArg(
       }
       }
 
 
       if (CalleeInfo.Payload) {
       if (CalleeInfo.Payload) {
-        CalleeInfo.FunctionDecl = CalledFunction;
+        CalleeInfo.funcDecl = CalledFunction;
         CalleeInfo.Stage = Info.Stage;
         CalleeInfo.Stage = Info.Stage;
         auto FieldsToIgnoreRead = CollectDominatingWritesForCall(Use, Info, DT);
         auto FieldsToIgnoreRead = CollectDominatingWritesForCall(Use, Info, DT);
         auto FieldsToIgnoreWrite = CollectReachableWritesForCall(Use, Info);
         auto FieldsToIgnoreWrite = CollectReachableWritesForCall(Use, Info);
@@ -925,7 +925,7 @@ DiagnosePayloadAccess(Sema &S, DxrShaderDiagnoseInfo &Info,
   clang::DominatorTree DT;
   clang::DominatorTree DT;
   AnalysisDeclContextManager AnalysisManager;
   AnalysisDeclContextManager AnalysisManager;
   AnalysisDeclContext *AnalysisContext =
   AnalysisDeclContext *AnalysisContext =
-      AnalysisManager.getContext(Info.FunctionDecl);
+      AnalysisManager.getContext(Info.funcDecl);
 
 
   CFG &TheCFG = *AnalysisContext->getCFG();
   CFG &TheCFG = *AnalysisContext->getCFG();
   DT.buildDominatorTree(*AnalysisContext);
   DT.buildDominatorTree(*AnalysisContext);
@@ -1093,7 +1093,7 @@ public:
         DiagnosePayloadParameter(S, Payload, Decl, Stage);
         DiagnosePayloadParameter(S, Payload, Decl, Stage);
       }
       }
       DxrShaderDiagnoseInfo Info;
       DxrShaderDiagnoseInfo Info;
-      Info.FunctionDecl = Decl;
+      Info.funcDecl = Decl;
       Info.Payload = Payload;
       Info.Payload = Payload;
       Info.Stage = Stage;
       Info.Stage = Stage;
 
 
@@ -1116,4 +1116,4 @@ void DiagnoseRaytracingPayloadAccess(clang::Sema &S,
   visitor.diagnose(TU);
   visitor.diagnose(TU);
 }
 }
 
 
-} // namespace hlsl
+} // namespace hlsl