diff options
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/Compiler.h | 17 | ||||
-rw-r--r-- | include/llvm/Support/DOTGraphTraits.h | 8 | ||||
-rw-r--r-- | include/llvm/Support/GraphWriter.h | 21 | ||||
-rw-r--r-- | include/llvm/Support/StandardPasses.h | 14 |
4 files changed, 45 insertions, 15 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h index 881a0fe..b2ce76d 100644 --- a/include/llvm/Support/Compiler.h +++ b/include/llvm/Support/Compiler.h @@ -15,12 +15,21 @@ #ifndef LLVM_SUPPORT_COMPILER_H #define LLVM_SUPPORT_COMPILER_H -// The VISIBILITY_HIDDEN macro, used for marking classes with the GCC-specific -// visibility("hidden") attribute. +/// LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked +/// into a shared library, then the class should be private to the library and +/// not accessible from outside it. Can also be used to mark variables and +/// functions, making them private to any shared library they are linked into. + +/// LLVM_GLOBAL_VISIBILITY - If a class marked with this attribute is linked +/// into a shared library, then the class will be accessible from outside the +/// the library. Can also be used to mark variables and functions, making them +/// accessible from outside any shared library they are linked into. #if (__GNUC__ >= 4) && !defined(__MINGW32__) && !defined(__CYGWIN__) -#define VISIBILITY_HIDDEN __attribute__ ((visibility("hidden"))) +#define LLVM_LIBRARY_VISIBILITY __attribute__ ((visibility("hidden"))) +#define LLVM_GLOBAL_VISIBILITY __attribute__ ((visibility("default"))) #else -#define VISIBILITY_HIDDEN +#define LLVM_LIBRARY_VISIBILITY +#define LLVM_GLOBAL_VISIBILITY #endif #if (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) diff --git a/include/llvm/Support/DOTGraphTraits.h b/include/llvm/Support/DOTGraphTraits.h index 54ced15..796c74a 100644 --- a/include/llvm/Support/DOTGraphTraits.h +++ b/include/llvm/Support/DOTGraphTraits.h @@ -36,7 +36,7 @@ protected: } public: - DefaultDOTGraphTraits (bool simple=false) : IsSimple (simple) {} + explicit DefaultDOTGraphTraits(bool simple=false) : IsSimple (simple) {} /// getGraphName - Return the label for the graph as a whole. Printed at the /// top of the graph. @@ -59,6 +59,12 @@ public: return false; } + /// isNodeHidden - If the function returns true, the given node is not + /// displayed in the graph. + static bool isNodeHidden(const void *Node) { + return false; + } + /// getNodeLabel - Given a node and a pointer to the top level graph, return /// the label to print in the node. template<typename GraphType> diff --git a/include/llvm/Support/GraphWriter.h b/include/llvm/Support/GraphWriter.h index 13e6682..559f004 100644 --- a/include/llvm/Support/GraphWriter.h +++ b/include/llvm/Support/GraphWriter.h @@ -122,7 +122,20 @@ public: // Loop over the graph, printing it out... for (node_iterator I = GTraits::nodes_begin(G), E = GTraits::nodes_end(G); I != E; ++I) - writeNode(*I); + if (!isNodeHidden(*I)) + writeNode(*I); + } + + bool isNodeHidden(NodeType &Node) { + return isNodeHidden(&Node); + } + + bool isNodeHidden(NodeType *const *Node) { + return isNodeHidden(*Node); + } + + bool isNodeHidden(NodeType *Node) { + return DTraits.isNodeHidden(Node); } void writeNode(NodeType& Node) { @@ -189,9 +202,11 @@ public: child_iterator EI = GTraits::child_begin(Node); child_iterator EE = GTraits::child_end(Node); for (unsigned i = 0; EI != EE && i != 64; ++EI, ++i) - writeEdge(Node, i, EI); + if (!DTraits.isNodeHidden(*EI)) + writeEdge(Node, i, EI); for (; EI != EE; ++EI) - writeEdge(Node, 64, EI); + if (!DTraits.isNodeHidden(*EI)) + writeEdge(Node, 64, EI); } void writeEdge(NodeType *Node, unsigned edgeidx, child_iterator EI) { diff --git a/include/llvm/Support/StandardPasses.h b/include/llvm/Support/StandardPasses.h index f233c18..b97ad29 100644 --- a/include/llvm/Support/StandardPasses.h +++ b/include/llvm/Support/StandardPasses.h @@ -31,7 +31,7 @@ namespace llvm { /// /// \arg OptimizationLevel - The optimization level, corresponding to -O0, /// -O1, etc. - static inline void createStandardFunctionPasses(FunctionPassManager *PM, + static inline void createStandardFunctionPasses(PassManagerBase *PM, unsigned OptimizationLevel); /// createStandardModulePasses - Add the standard list of module passes to the @@ -46,7 +46,7 @@ namespace llvm { /// \arg HaveExceptions - Whether the module may have code using exceptions. /// \arg InliningPass - The inlining pass to use, if any, or null. This will /// always be added, even at -O0.a - static inline void createStandardModulePasses(PassManager *PM, + static inline void createStandardModulePasses(PassManagerBase *PM, unsigned OptimizationLevel, bool OptimizeSize, bool UnitAtATime, @@ -61,14 +61,14 @@ namespace llvm { /// Internalize - Run the internalize pass. /// RunInliner - Use a function inlining pass. /// VerifyEach - Run the verifier after each pass. - static inline void createStandardLTOPasses(PassManager *PM, + static inline void createStandardLTOPasses(PassManagerBase *PM, bool Internalize, bool RunInliner, bool VerifyEach); // Implementations - static inline void createStandardFunctionPasses(FunctionPassManager *PM, + static inline void createStandardFunctionPasses(PassManagerBase *PM, unsigned OptimizationLevel) { if (OptimizationLevel > 0) { PM->add(createCFGSimplificationPass()); @@ -82,7 +82,7 @@ namespace llvm { /// createStandardModulePasses - Add the standard module passes. This is /// expected to be run after the standard function passes. - static inline void createStandardModulePasses(PassManager *PM, + static inline void createStandardModulePasses(PassManagerBase *PM, unsigned OptimizationLevel, bool OptimizeSize, bool UnitAtATime, @@ -164,14 +164,14 @@ namespace llvm { } } - static inline void addOnePass(PassManager *PM, Pass *P, bool AndVerify) { + static inline void addOnePass(PassManagerBase *PM, Pass *P, bool AndVerify) { PM->add(P); if (AndVerify) PM->add(createVerifierPass()); } - static inline void createStandardLTOPasses(PassManager *PM, + static inline void createStandardLTOPasses(PassManagerBase *PM, bool Internalize, bool RunInliner, bool VerifyEach) { |