[PATCH] D156154: [clang][ConstExprEmitter] handle IntegerLiterals and IntegralCasts
Nick Desaulniers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 24 11:41:35 PDT 2023
nickdesaulniers updated this revision to Diff 543662.
nickdesaulniers marked an inline comment as done.
nickdesaulniers added a comment.
- put back the IntegralCast, for now
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156154/new/
https://reviews.llvm.org/D156154
Files:
clang/lib/CodeGen/CGExprConstant.cpp
Index: clang/lib/CodeGen/CGExprConstant.cpp
===================================================================
--- clang/lib/CodeGen/CGExprConstant.cpp
+++ clang/lib/CodeGen/CGExprConstant.cpp
@@ -1215,6 +1215,10 @@
return Visit(E->getSubExpr(), T);
}
+ llvm::Constant *VisitIntegerLiteral(IntegerLiteral *I, QualType T) {
+ return llvm::ConstantInt::get(CGM.getLLVMContext(), I->getValue());
+ }
+
llvm::Constant *EmitArrayInitialization(InitListExpr *ILE, QualType T) {
auto *CAT = CGM.getContext().getAsConstantArrayType(ILE->getType());
assert(CAT && "can't emit array init for non-constant-bound array");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156154.543662.patch
Type: text/x-patch
Size: 639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230724/6dd87ea5/attachment.bin>
More information about the cfe-commits
mailing list