[llvm] r347250 - [IR] DISubprogram::toSPFlags(): fix "enumeral and non-enumeral type in conditional expression"
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 19 11:07:03 PST 2018
Author: lebedevri
Date: Mon Nov 19 11:07:03 2018
New Revision: 347250
URL: http://llvm.org/viewvc/llvm-project?rev=347250&view=rev
Log:
[IR] DISubprogram::toSPFlags(): fix "enumeral and non-enumeral type in conditional expression"
/build/llvm/include/llvm/IR/DebugInfoMetadata.h: In static member function ‘static llvm::DISubprogram::DISPFlags llvm::DISubprogram::toSPFlags(bool, bool, bool, unsigned int)’:
/build/llvm/include/llvm/IR/DebugInfoMetadata.h:1636:50: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
(IsLocalToUnit ? SPFlagLocalToUnit : 0) |
~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/build/llvm/include/llvm/IR/DebugInfoMetadata.h:1637:49: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
(IsDefinition ? SPFlagDefinition : 0) |
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/build/llvm/include/llvm/IR/DebugInfoMetadata.h:1638:48: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
(IsOptimized ? SPFlagOptimized : 0));
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
Modified:
llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
Modified: llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfoMetadata.h?rev=347250&r1=347249&r2=347250&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfoMetadata.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfoMetadata.h Mon Nov 19 11:07:03 2018
@@ -1632,10 +1632,11 @@ public:
int(SPFlagVirtual) == int(dwarf::DW_VIRTUALITY_virtual) &&
int(SPFlagPureVirtual) == int(dwarf::DW_VIRTUALITY_pure_virtual),
"Virtuality constant mismatch");
- return static_cast<DISPFlags>((Virtuality & SPFlagVirtuality) |
- (IsLocalToUnit ? SPFlagLocalToUnit : 0) |
- (IsDefinition ? SPFlagDefinition : 0) |
- (IsOptimized ? SPFlagOptimized : 0));
+ return static_cast<DISPFlags>(
+ (Virtuality & SPFlagVirtuality) |
+ (IsLocalToUnit ? SPFlagLocalToUnit : SPFlagZero) |
+ (IsDefinition ? SPFlagDefinition : SPFlagZero) |
+ (IsOptimized ? SPFlagOptimized : SPFlagZero));
}
private:
More information about the llvm-commits
mailing list