1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

Fix an ODR violation consisting of two 'struct Query' in the global namespace.

Put them in their own anonymous namespaces. Found by GCC's new -Wodr (PR20915).

llvm-svn: 217662
This commit is contained in:
Benjamin Kramer 2014-09-12 08:56:53 +00:00
parent 2789757d73
commit ad466ef0b8
2 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,7 @@ enum { RecursionLimit = 3 };
STATISTIC(NumExpand, "Number of expansions");
STATISTIC(NumReassoc, "Number of reassociations");
namespace {
struct Query {
const DataLayout *DL;
const TargetLibraryInfo *TLI;
@ -53,6 +54,7 @@ struct Query {
const Instruction *cxti = nullptr)
: DL(DL), TLI(tli), DT(dt), AT(at), CxtI(cxti) {}
};
} // end anonymous namespace
static Value *SimplifyAndInst(Value *, Value *, const Query &, unsigned);
static Value *SimplifyBinOp(unsigned, Value *, Value *, const Query &,

View File

@ -58,6 +58,7 @@ static unsigned getBitWidth(Type *Ty, const DataLayout *TD) {
// isKnownToBeAPowerOfTwo (all of which can call computeKnownBits), and so on.
typedef SmallPtrSet<const Value *, 8> ExclInvsSet;
namespace {
// Simplifying using an assume can only be done in a particular control-flow
// context (the context instruction provides that context). If an assume and
// the context instruction are not in the same block then the DT helps in
@ -77,6 +78,7 @@ struct Query {
ExclInvs.insert(NewExcl);
}
};
} // end anonymous namespace
// Given the provided Value and, potentially, a context instruction, returned
// the preferred context instruction (if any).