diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2016-03-11 16:25:19 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2016-03-11 16:25:19 +0000 |
commit | ace8c8f7659a4554a564f0b1353f3bfeadc12842 (patch) | |
tree | 2d4deba97723a645e2271693dc0c14e5760c00ec /llvm/lib/Transforms | |
parent | b20dcb1483515ed33281fdfa6c15b4a068d34de4 (diff) | |
download | bcm5719-llvm-ace8c8f7659a4554a564f0b1353f3bfeadc12842.tar.gz bcm5719-llvm-ace8c8f7659a4554a564f0b1353f3bfeadc12842.zip |
[PM] Sink the "Expression" type for GVN into the class as a private
member type.
Because of how this type is used by the ValueTable, it cannot actually
have hidden visibility. GCC actually nicely warns about this but Clang
just silently ... I don't even know. =/ We should do a better job either
way though.
This should resolve a bunch of the GCC warnings about visibility that
the port of GVN triggered and make the visibility story a bit more
correct.
llvm-svn: 263250
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/GVN.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index 49037aed56b..f286eb209cb 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/lib/Transforms/Scalar/GVN.cpp @@ -75,7 +75,7 @@ static cl::opt<uint32_t> MaxRecurseDepth("max-recurse-depth", cl::Hidden, cl::init(1000), cl::ZeroOrMore, cl::desc("Max recurse depth (default = 1000)")); -struct llvm::gvn::Expression { +struct llvm::GVN::Expression { uint32_t opcode; Type *type; SmallVector<uint32_t, 4> varargs; @@ -102,16 +102,16 @@ struct llvm::gvn::Expression { }; namespace llvm { -template <> struct DenseMapInfo<Expression> { - static inline Expression getEmptyKey() { return ~0U; } +template <> struct DenseMapInfo<GVN::Expression> { + static inline GVN::Expression getEmptyKey() { return ~0U; } - static inline Expression getTombstoneKey() { return ~1U; } + static inline GVN::Expression getTombstoneKey() { return ~1U; } - static unsigned getHashValue(const Expression e) { + static unsigned getHashValue(const GVN::Expression e) { using llvm::hash_value; return static_cast<unsigned>(hash_value(e)); } - static bool isEqual(const Expression &LHS, const Expression &RHS) { + static bool isEqual(const GVN::Expression &LHS, const GVN::Expression &RHS) { return LHS == RHS; } }; @@ -229,7 +229,7 @@ struct llvm::gvn::AvailableValueInBlock { // ValueTable Internal Functions //===----------------------------------------------------------------------===// -Expression GVN::ValueTable::create_expression(Instruction *I) { +GVN::Expression GVN::ValueTable::create_expression(Instruction *I) { Expression e; e.type = I->getType(); e.opcode = I->getOpcode(); @@ -263,9 +263,8 @@ Expression GVN::ValueTable::create_expression(Instruction *I) { return e; } -Expression GVN::ValueTable::create_cmp_expression(unsigned Opcode, - CmpInst::Predicate Predicate, - Value *LHS, Value *RHS) { +GVN::Expression GVN::ValueTable::create_cmp_expression( + unsigned Opcode, CmpInst::Predicate Predicate, Value *LHS, Value *RHS) { assert((Opcode == Instruction::ICmp || Opcode == Instruction::FCmp) && "Not a comparison!"); Expression e; @@ -282,7 +281,8 @@ Expression GVN::ValueTable::create_cmp_expression(unsigned Opcode, return e; } -Expression GVN::ValueTable::create_extractvalue_expression(ExtractValueInst *EI) { +GVN::Expression +GVN::ValueTable::create_extractvalue_expression(ExtractValueInst *EI) { assert(EI && "Not an ExtractValueInst?"); Expression e; e.type = EI->getType(); |