aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/ByteCode/Context.cpp')
-rw-r--r--clang/lib/AST/ByteCode/Context.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/clang/lib/AST/ByteCode/Context.cpp b/clang/lib/AST/ByteCode/Context.cpp
index 306f95c..683e916 100644
--- a/clang/lib/AST/ByteCode/Context.cpp
+++ b/clang/lib/AST/ByteCode/Context.cpp
@@ -567,9 +567,15 @@ const Function *Context::getOrCreateFunction(const FunctionDecl *FuncDecl) {
// Assign descriptors to all parameters.
// Composite objects are lowered to pointers.
for (const ParmVarDecl *PD : FuncDecl->parameters()) {
+ bool IsConst = PD->getType().isConstQualified();
+ bool IsVolatile = PD->getType().isVolatileQualified();
+
OptPrimType T = classify(PD->getType());
PrimType PT = T.value_or(PT_Ptr);
- Descriptor *Desc = P->createDescriptor(PD, PT);
+ Descriptor *Desc = P->createDescriptor(PD, PT, nullptr, std::nullopt,
+ IsConst, /*IsTemporary=*/false,
+ /*IsMutable=*/false, IsVolatile);
+
ParamDescriptors.insert({ParamOffset, {PT, Desc}});
ParamOffsets.push_back(ParamOffset);
ParamOffset += align(primSize(PT));
@@ -595,9 +601,14 @@ const Function *Context::getOrCreateObjCBlock(const BlockExpr *E) {
// Assign descriptors to all parameters.
// Composite objects are lowered to pointers.
for (const ParmVarDecl *PD : BD->parameters()) {
+ bool IsConst = PD->getType().isConstQualified();
+ bool IsVolatile = PD->getType().isVolatileQualified();
+
OptPrimType T = classify(PD->getType());
PrimType PT = T.value_or(PT_Ptr);
- Descriptor *Desc = P->createDescriptor(PD, PT);
+ Descriptor *Desc = P->createDescriptor(PD, PT, nullptr, std::nullopt,
+ IsConst, /*IsTemporary=*/false,
+ /*IsMutable=*/false, IsVolatile);
ParamDescriptors.insert({ParamOffset, {PT, Desc}});
ParamOffsets.push_back(ParamOffset);
ParamOffset += align(primSize(PT));