From cfd8d909693126fbbaac3d02ce0dd84a443bca87 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 12 Sep 2014 08:56:53 +0000 Subject: 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 --- llvm/lib/Analysis/InstructionSimplify.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp') diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index cd795fdb781..32bc25ad8c8 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -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 &, -- cgit v1.2.3