r205915 - Thread Safety Analysis: some minor cleanups to the latest thread safety changes. No functional changes intended.
Justin Bogner
mail at justinbogner.com
Wed Apr 9 14:33:01 PDT 2014
Aaron Ballman <aaron at aaronballman.com> writes:
> Thread Safety Analysis: some minor cleanups to the latest thread
> safety changes. No functional changes intended.
>
> * Adds an iterator_range interface to CallExpr to get the arguments
> * Modifies SExpr such that it must be allocated in the Arena, and
> cannot be deleted
> * Minor const-correctness and nullptr updates
> * Adds some operator!= implementations to complement operator==
> * Removes unused functionality
>
> Modified:
> cfe/trunk/include/clang/AST/Expr.h
> cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyCommon.h
> cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h
> cfe/trunk/lib/Analysis/ThreadSafetyCommon.cpp
...
> Modified: cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h?rev=205915&r1=205914&r2=205915&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h (original)
> +++ cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h Wed Apr 9 12:45:44 2014
...
> // Contains various helper functions for SExprs.
> -class ThreadSafetyTIL {
> -public:
> - static const int MaxOpcode = COP_MAX;
> -
> - static inline bool isTrivial(SExpr *E) {
> - unsigned Op = E->opcode();
> - return Op == COP_Variable || Op == COP_Literal || Op == COP_LiteralPtr;
> - }
> -
> - static inline bool isLargeValue(SExpr *E) {
> - unsigned Op = E->opcode();
> - return (Op >= COP_Function && Op <= COP_Code);
> - }
> -};
> -
> +namespace ThreadSafetyTIL {
> +static bool isTrivial(SExpr *E) {
> + unsigned Op = E->opcode();
> + return Op == COP_Variable || Op == COP_Literal || Op == COP_LiteralPtr;
> +}
> +}
I don't think isTrivial should be static. I'm getting a warning about
this being an unused function during the compile of ThreadSafety.cpp
after this change.
More information about the cfe-commits
mailing list