Jelajahi Sumber

[linux-port] Fix preprocessor warnings (#1323)

Remove pragma once from source files. It has no meaning in a source
file unless it's used as a header, which, fortunately, none of
these are.
Fixes 3 clang and 3 gcc warnings.

Remove trailing tokens after #endifs. Common result from copy,
paste, and slightly alter the beginning #if line to keep the
comments after consistent.
Fixes 3 clang and 3 gcc warnings.
Greg Roth 7 tahun lalu
induk
melakukan
57f1909f5d

+ 0 - 2
lib/HLSL/HLOperations.cpp

@@ -9,8 +9,6 @@
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-#pragma once
-
 #include "dxc/HLSL/HLOperations.h"
 #include "dxc/HlslIntrinsicOp.h"
 #include "llvm/IR/Function.h"

+ 1 - 1
tools/clang/lib/CodeGen/CGClass.cpp

@@ -1458,7 +1458,7 @@ void CodeGenFunction::EmitDestructorBody(FunctionArgList &Args) {
                             /*Delegating=*/false, LoadCXXThis());
       break;
     }
-#endif 1 // HLSL Change - no support for exception handling
+#endif // HLSL Change - no support for exception handling
     // Fallthrough: act like we're in the base variant.
 
   case Dtor_Base:

+ 1 - 1
tools/clang/lib/Frontend/FrontendAction.cpp

@@ -369,7 +369,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
       if (!CI.getASTContext().getExternalSource())
         goto failure;
     }
-#endif 0 // HLSL Change Ends - no support for AST serialization
+#endif // HLSL Change Ends - no support for AST serialization
 
     CI.setASTConsumer(std::move(Consumer));
     if (!CI.hasASTConsumer())

+ 1 - 1
tools/clang/lib/Sema/SemaChecking.cpp

@@ -1355,7 +1355,7 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto,
       }
     }
   }
-#endif 0 // HLSL Change - no format string support
+#endif // HLSL Change - no format string support
   if (FDecl || Proto) {
     CheckNonNullArguments(*this, FDecl, Proto, Args, Loc);
 

+ 0 - 2
tools/clang/tools/dxcompiler/dxcfilesystem.cpp

@@ -9,8 +9,6 @@
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-#pragma once
-
 #include "dxc/Support/WinIncludes.h"
 #include "dxc/HLSL/DxilContainer.h"
 #include "dxc/Support/Global.h"

+ 1 - 3
tools/clang/tools/dxcompiler/dxcutil.cpp

@@ -9,8 +9,6 @@
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-#pragma once
-
 #include "dxc/Support/WinIncludes.h"
 #include "dxc/HLSL/DxilContainer.h"
 #include "dxc/Support/Global.h"
@@ -227,4 +225,4 @@ bool IsAbsoluteOrCurDirRelative(const Twine &T) {
   return false;
 }
 
-} // namespace dxcutil
+} // namespace dxcutil