<commit_before>#include "AndersenAA.h"

#include "llvm/IR/Module.h"

using namespace llvm;

static inline bool isSetContainingOnly(const AndersPtsSet& set, NodeIndex i)
{
	return (set.getSize() == 1) && (*set.begin() == i);
}

AliasAnalysis::AliasResult AndersenAA::andersenAlias(const llvm::Value* v1, const llvm::Value* v2)
{
	NodeIndex n1 = (anders->nodeFactory).getMergeTarget((anders->nodeFactory).getValueNodeFor(v1));
	NodeIndex n2 = (anders->nodeFactory).getMergeTarget((anders->nodeFactory).getValueNodeFor(v2));

	if (n1 == n2)
		return AliasAnalysis::MustAlias;

	auto itr1 = (anders->ptsGraph).find(n1), itr2 = (anders->ptsGraph).find(n2);
	if (itr1 == (anders->ptsGraph).end() || itr2 == (anders->ptsGraph).end())
		// We knows nothing about at least one of (v1, v2)
		// My claim is that at least one of them must be non-pointer, hence we could return NoAlias here
		return AliasAnalysis::NoAlias;

	AndersPtsSet& s1 = itr1->second, s2 = itr2->second;
	bool isNull1 = isSetContainingOnly(s1, (anders->nodeFactory).getNullObjectNode());<commit_msg>Compile with LLVM 3.5<commit_after>#include "AndersenAA.h"

#include "llvm/IR/Module.h"

using namespace llvm;

static inline bool isSetContainingOnly(const AndersPtsSet& set, NodeIndex i)
{
	return (set.getSize() == 1) && (*set.begin() == i);
}

AliasAnalysis::AliasResult AndersenAA::andersenAlias(const llvm::Value* v1, const llvm::Value* v2)
{
	NodeIndex n1 = (anders->nodeFactory).getMergeTarget((anders->nodeFactory).getValueNodeFor(v1));
	NodeIndex n2 = (anders->nodeFactory).getMergeTarget((anders->nodeFactory).getValueNodeFor(v2));

	if (n1 == n2)
		return AliasAnalysis::MustAlias;

	auto itr1 = (anders->ptsGraph).find(n1), itr2 = (anders->ptsGraph).find(n2);
	if (itr1 == (anders->ptsGraph).end() || itr2 == (anders->ptsGraph).end())
		// We knows nothing about at least one of (v1, v2)
		return AliasAnalysis::MayAlias;

	AndersPtsSet& s1 = itr1->second, s2 = itr2->second;
	bool isNull1 = isSetContainingOnly(s1, (anders->nodeFactory).getNullObjectNode());
{'fraction_non_alphanumeric': 0.15994094488188976, 'fraction_numerical': 0.023622047244094488, 'mean_word_length': 5.79933110367893, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5172465', 'n_tokens_mistral': 745, 'n_tokens_neox': 735, 'n_words': 158}