diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h --- a/llvm/include/llvm/Transforms/IPO/Attributor.h +++ b/llvm/include/llvm/Transforms/IPO/Attributor.h @@ -172,7 +172,7 @@ /// Default constructor available to create invalid positions implicitly. All /// other positions need to be created explicitly through the appropriate /// static member function. - IRPosition() : Enc(nullptr, ENC_VALUE) { verify(); } + IRPosition() : Enc(nullptr, ENC_VALUE), CBContext(nullptr) { verify(); } /// Create a position describing the value of \p V. static const IRPosition value(const Value &V, @@ -453,9 +453,9 @@ /// Return the same position without the call base context. IRPosition stripCallBaseContext() const { - IRPosition result = *this; - result.CBContext = nullptr; - return result; + IRPosition Result = *this; + Result.CBContext = nullptr; + return Result; } /// Get the call base context from the position. @@ -518,7 +518,7 @@ /// IRPosition for the use \p U. The position kind \p PK needs to be /// IRP_CALL_SITE_ARGUMENT, the anchor value is the user, the associated value /// the used value. - explicit IRPosition(Use &U, Kind PK) { + explicit IRPosition(Use &U, Kind PK) : CBContext(nullptr) { assert(PK == IRP_CALL_SITE_ARGUMENT && "Use constructor is for call site arguments only!"); Enc = {&U, ENC_CALL_SITE_ARGUMENT_USE}; @@ -912,7 +912,7 @@ return getOrCreateAAFor(IRP, &QueryingAA, TrackDependence, DepClass, /* ForceUpdate */ true); } - +#define DEBUG_TYPE "attributor" /// The version of getAAFor that allows to omit a querying abstract /// attribute. Using this after Attributor started running is restricted to /// only the Attributor itself. Initial seeding of AAs can be done via this @@ -934,8 +934,8 @@ "across functions"); } #endif - IRP = - shouldPropagateCallBaseContext(IRP) ? IRP : IRP.stripCallBaseContext(); + if (shouldPropagateCallBaseContext(IRP)) + IRP = IRP.stripCallBaseContext(); if (AAType *AAPtr = lookupAAFor(IRP, QueryingAA, TrackDependence)) { if (ForceUpdate) @@ -994,7 +994,7 @@ DepClass); return AA; } - +#undef DEBUG_TYPE /// Return the attribute of \p AAType for \p IRP if existing. This also allows /// non-AA users lookup. template