aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-09-12 08:56:53 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-09-12 08:56:53 +0000
commitcfd8d909693126fbbaac3d02ce0dd84a443bca87 (patch)
tree36bde5fb58f18db2960d4cdbc130462533c37743 /llvm/lib/Analysis/ValueTracking.cpp
parent6e0cbc89471c210c59cd080901b1dfe656db117f (diff)
downloadllvm-cfd8d909693126fbbaac3d02ce0dd84a443bca87.zip
llvm-cfd8d909693126fbbaac3d02ce0dd84a443bca87.tar.gz
llvm-cfd8d909693126fbbaac3d02ce0dd84a443bca87.tar.bz2
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
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 74c862a..f208bb7 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -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).