@@ -146,14 +146,6 @@ int countIndirectionsForCppType(LanguageType langType) {
146
146
)
147
147
}
148
148
149
- /**
150
- * A `CallInstruction` that calls an allocation function such
151
- * as `malloc` or `operator new`.
152
- */
153
- class AllocationInstruction extends CallInstruction {
154
- AllocationInstruction ( ) { this .getStaticCallTarget ( ) instanceof Cpp:: AllocationFunction }
155
- }
156
-
157
149
private predicate isIndirectionType ( Type t ) { t instanceof Indirection }
158
150
159
151
private predicate hasUnspecifiedBaseType ( Indirection t , Type base ) {
@@ -368,7 +360,7 @@ newtype TBaseSourceVariable =
368
360
// Each IR variable gets its own source variable
369
361
TBaseIRVariable ( IRVariable var ) or
370
362
// Each allocation gets its own source variable
371
- TBaseCallVariable ( AllocationInstruction call )
363
+ TBaseCallVariable ( CallInstruction call ) { not call . getResultIRType ( ) instanceof IRVoidType }
372
364
373
365
abstract private class AbstractBaseSourceVariable extends TBaseSourceVariable {
374
366
/** Gets a textual representation of this element. */
@@ -396,11 +388,11 @@ class BaseIRVariable extends AbstractBaseSourceVariable, TBaseIRVariable {
396
388
}
397
389
398
390
class BaseCallVariable extends AbstractBaseSourceVariable , TBaseCallVariable {
399
- AllocationInstruction call ;
391
+ CallInstruction call ;
400
392
401
393
BaseCallVariable ( ) { this = TBaseCallVariable ( call ) }
402
394
403
- AllocationInstruction getCallInstruction ( ) { result = call }
395
+ CallInstruction getCallInstruction ( ) { result = call }
404
396
405
397
override string toString ( ) { result = call .toString ( ) }
406
398
@@ -504,8 +496,7 @@ private class BaseIRVariableInstruction extends BaseSourceVariableInstruction,
504
496
override BaseIRVariable getBaseSourceVariable ( ) { result .getIRVariable ( ) = this .getIRVariable ( ) }
505
497
}
506
498
507
- private class BaseAllocationInstruction extends BaseSourceVariableInstruction , AllocationInstruction
508
- {
499
+ private class BaseCallInstruction extends BaseSourceVariableInstruction , CallInstruction {
509
500
override BaseCallVariable getBaseSourceVariable ( ) { result .getCallInstruction ( ) = this }
510
501
}
511
502
0 commit comments