johannes updated this revision to Diff 229556. johannes added a comment. Remove unneccesary const on parameter
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70302/new/ https://reviews.llvm.org/D70302 Files: clang/lib/CodeGen/CGExprAgg.cpp clang/lib/CodeGen/CGExprScalar.cpp clang/lib/CodeGen/ConstantEmitter.h clang/test/CodeGen/label-array-aggregate-init.c Index: clang/test/CodeGen/label-array-aggregate-init.c =================================================================== --- /dev/null +++ clang/test/CodeGen/label-array-aggregate-init.c @@ -0,0 +1,6 @@ +// RUN: %clang -cc1 -emit-llvm %s -o /dev/null + +int main() { +L: + (void)(void *[]){ &&L, 0, 0 }; +} Index: clang/lib/CodeGen/ConstantEmitter.h =================================================================== --- clang/lib/CodeGen/ConstantEmitter.h +++ clang/lib/CodeGen/ConstantEmitter.h @@ -23,7 +23,7 @@ class ConstantEmitter { public: CodeGenModule &CGM; - CodeGenFunction *CGF; + CodeGenFunction *const CGF; private: bool Abstract = false; Index: clang/lib/CodeGen/CGExprScalar.cpp =================================================================== --- clang/lib/CodeGen/CGExprScalar.cpp +++ clang/lib/CodeGen/CGExprScalar.cpp @@ -644,8 +644,8 @@ auto &Ctx = CGF.getContext(); APValue Evaluated = SLE->EvaluateInContext(Ctx, CGF.CurSourceLocExprScope.getDefaultExpr()); - return ConstantEmitter(CGF.CGM, &CGF) - .emitAbstract(SLE->getLocation(), Evaluated, SLE->getType()); + return ConstantEmitter(CGF).emitAbstract(SLE->getLocation(), Evaluated, + SLE->getType()); } Value *VisitCXXDefaultArgExpr(CXXDefaultArgExpr *DAE) { Index: clang/lib/CodeGen/CGExprAgg.cpp =================================================================== --- clang/lib/CodeGen/CGExprAgg.cpp +++ clang/lib/CodeGen/CGExprAgg.cpp @@ -493,7 +493,7 @@ if (NumInitElements * elementSize.getQuantity() > 16 && elementType.isTriviallyCopyableType(CGF.getContext())) { CodeGen::CodeGenModule &CGM = CGF.CGM; - ConstantEmitter Emitter(CGM); + ConstantEmitter Emitter(CGF); LangAS AS = ArrayQTy.getAddressSpace(); if (llvm::Constant *C = Emitter.tryEmitForInitializer(E, AS, ArrayQTy)) { auto GV = new llvm::GlobalVariable(
Index: clang/test/CodeGen/label-array-aggregate-init.c =================================================================== --- /dev/null +++ clang/test/CodeGen/label-array-aggregate-init.c @@ -0,0 +1,6 @@ +// RUN: %clang -cc1 -emit-llvm %s -o /dev/null + +int main() { +L: + (void)(void *[]){ &&L, 0, 0 }; +} Index: clang/lib/CodeGen/ConstantEmitter.h =================================================================== --- clang/lib/CodeGen/ConstantEmitter.h +++ clang/lib/CodeGen/ConstantEmitter.h @@ -23,7 +23,7 @@ class ConstantEmitter { public: CodeGenModule &CGM; - CodeGenFunction *CGF; + CodeGenFunction *const CGF; private: bool Abstract = false; Index: clang/lib/CodeGen/CGExprScalar.cpp =================================================================== --- clang/lib/CodeGen/CGExprScalar.cpp +++ clang/lib/CodeGen/CGExprScalar.cpp @@ -644,8 +644,8 @@ auto &Ctx = CGF.getContext(); APValue Evaluated = SLE->EvaluateInContext(Ctx, CGF.CurSourceLocExprScope.getDefaultExpr()); - return ConstantEmitter(CGF.CGM, &CGF) - .emitAbstract(SLE->getLocation(), Evaluated, SLE->getType()); + return ConstantEmitter(CGF).emitAbstract(SLE->getLocation(), Evaluated, + SLE->getType()); } Value *VisitCXXDefaultArgExpr(CXXDefaultArgExpr *DAE) { Index: clang/lib/CodeGen/CGExprAgg.cpp =================================================================== --- clang/lib/CodeGen/CGExprAgg.cpp +++ clang/lib/CodeGen/CGExprAgg.cpp @@ -493,7 +493,7 @@ if (NumInitElements * elementSize.getQuantity() > 16 && elementType.isTriviallyCopyableType(CGF.getContext())) { CodeGen::CodeGenModule &CGM = CGF.CGM; - ConstantEmitter Emitter(CGM); + ConstantEmitter Emitter(CGF); LangAS AS = ArrayQTy.getAddressSpace(); if (llvm::Constant *C = Emitter.tryEmitForInitializer(E, AS, ArrayQTy)) { auto GV = new llvm::GlobalVariable(
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits