File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -361,6 +361,25 @@ private static bool IsConst(this QualifiedType type)
361
361
type . Type . GetQualifiedPointee ( ) . IsConst ( ) ) ;
362
362
}
363
363
364
+ public static QualifiedType StripConst ( this QualifiedType type )
365
+ {
366
+ var qualifiers = type . Qualifiers ;
367
+ qualifiers . IsConst = false ;
368
+ type . Qualifiers = qualifiers ;
369
+
370
+ var ptr = type . Type as PointerType ;
371
+ if ( ptr != null )
372
+ {
373
+ var pointee = ptr . QualifiedPointee ;
374
+ var pointeeQualifiers = pointee . Qualifiers ;
375
+ pointeeQualifiers . IsConst = false ;
376
+ pointee . Qualifiers = pointeeQualifiers ;
377
+ ptr . QualifiedPointee = pointee ;
378
+ }
379
+
380
+ return type ;
381
+ }
382
+
364
383
public static bool IsConstCharString ( this Type type )
365
384
{
366
385
var desugared = type . Desugar ( ) ;
You can’t perform that action at this time.
0 commit comments