diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-05 21:10:45 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-05 21:10:45 +0000 |
commit | 1de3c7e79010c43300a2637c3020a1489a3dd0de (patch) | |
tree | 637d041245eb1fc7fee37ea9b5a5d14e9911e5f6 /llvm/lib/Analysis/CFLAliasAnalysis.cpp | |
parent | f880d35b80dd7fda9ddfffeff7383614318b1bdb (diff) | |
download | bcm5719-llvm-1de3c7e79010c43300a2637c3020a1489a3dd0de.tar.gz bcm5719-llvm-1de3c7e79010c43300a2637c3020a1489a3dd0de.zip |
IR: Introduce ConstantAggregate, NFC
Add a common parent class for ConstantArray, ConstantVector, and
ConstantStruct called ConstantAggregate. These are the aggregate
subclasses of Constant that take operands.
This is mainly a cleanup, adding common `isa` target and removing
duplicated code. However, it also simplifies caching which constants
point transitively at `GlobalValue` (a possible future direction).
llvm-svn: 265466
Diffstat (limited to 'llvm/lib/Analysis/CFLAliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/CFLAliasAnalysis.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/CFLAliasAnalysis.cpp b/llvm/lib/Analysis/CFLAliasAnalysis.cpp index 6e6df987628..7d5ccac2155 100644 --- a/llvm/lib/Analysis/CFLAliasAnalysis.cpp +++ b/llvm/lib/Analysis/CFLAliasAnalysis.cpp @@ -894,13 +894,12 @@ static bool canSkipAddingToSets(Value *Val) { // we should filter out the (potentially shared) instance to // i32* null. if (isa<Constant>(Val)) { - bool Container = isa<ConstantVector>(Val) || isa<ConstantArray>(Val) || - isa<ConstantStruct>(Val); // TODO: Because all of these things are constant, we can determine whether // the data is *actually* mutable at graph building time. This will probably // come for free/cheap with offset awareness. - bool CanStoreMutableData = - isa<GlobalValue>(Val) || isa<ConstantExpr>(Val) || Container; + bool CanStoreMutableData = isa<GlobalValue>(Val) || + isa<ConstantExpr>(Val) || + isa<ConstantAggregate>(Val); return !CanStoreMutableData; } |