[clang] a7e3de2 - [NFC] Fix build error ignored by MSVC.

Xiang Li via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 21 10:58:15 PDT 2022


Author: Xiang Li
Date: 2022-09-21T10:57:43-07:00
New Revision: a7e3de2450f5b62e7dfe8999443f15be5dfec0b0

URL: https://github.com/llvm/llvm-project/commit/a7e3de2450f5b62e7dfe8999443f15be5dfec0b0
DIFF: https://github.com/llvm/llvm-project/commit/a7e3de2450f5b62e7dfe8999443f15be5dfec0b0.diff

LOG: [NFC] Fix build error ignored by MSVC.

Added: 
    

Modified: 
    clang/include/clang/AST/Decl.h
    clang/lib/CodeGen/CGDecl.cpp
    clang/lib/Parse/ParseHLSL.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index c850fa3f5d41e..4a33b939aba51 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -4693,7 +4693,7 @@ class HLSLBufferDecl final : public NamedDecl, public DeclContext {
                                 SourceLocation LBrace);
   static HLSLBufferDecl *CreateDeserialized(ASTContext &C, unsigned ID);
 
-  SourceRange getSourceRange() const LLVM_READONLY {
+  SourceRange getSourceRange() const override LLVM_READONLY {
     return SourceRange(getLocStart(), RBraceLoc);
   }
   SourceLocation getLocStart() const LLVM_READONLY { return KwLoc; }

diff  --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 28355374700bb..85d45f4b20265 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -179,6 +179,9 @@ void CodeGenFunction::EmitDecl(const Decl &D) {
       EmitVariablyModifiedType(Ty);
     return;
   }
+  case Decl::HLSLBuffer:
+    // FIXME: add codegen for HLSLBuffer.
+    return;
   }
 }
 

diff  --git a/clang/lib/Parse/ParseHLSL.cpp b/clang/lib/Parse/ParseHLSL.cpp
index 1d74aa0b09078..a7e1944acaa1d 100644
--- a/clang/lib/Parse/ParseHLSL.cpp
+++ b/clang/lib/Parse/ParseHLSL.cpp
@@ -73,7 +73,6 @@ Decl *Parser::ParseHLSLBuffer(SourceLocation &DeclEnd) {
 
   // FIXME: support attribute on cbuffer/tbuffer.
   while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof)) {
-    SourceLocation Loc = Tok.getLocation();
     // FIXME: support attribute on constants inside cbuffer/tbuffer.
     ParsedAttributes Attrs(AttrFactory);
 


        


More information about the cfe-commits mailing list