Incorrect result in LLVM Alias Analysis

我们两清 提交于 2019-12-24 02:16:08

问题


I want to check if the values a and b in the program alias.

int main() { 
int *a,*b; 
a=(int *)malloc(sizeof(int));
b=(int *)malloc(sizeof(int));
*a=10;
*b=8;
return 0;
 }

I use the below code for this (getAnalysisUsage method has been defined)

AliasAnalysis::Location loc1=AliasAnalysis::Location(k1);  //a
AliasAnalysis::Location loc2=AliasAnalysis::Location(k2);  //b
AliasAnalysis::AliasResult ar=AA.alias(loc1,loc2);

But I get ar=1 i.e May Alias result. Where am I going wrong? I have included -basicaa option in the opt command for running this.

来源:https://stackoverflow.com/questions/9999623/incorrect-result-in-llvm-alias-analysis

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!