[llvm] r266512 - [DebugInfo] Correct the assertion introduced in r266509 + update test.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 15 20:23:54 PDT 2016
Author: davide
Date: Fri Apr 15 22:23:48 2016
New Revision: 266512
URL: http://llvm.org/viewvc/llvm-project?rev=266512&view=rev
Log:
[DebugInfo] Correct the assertion introduced in r266509 + update test.
Modified:
llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
llvm/trunk/unittests/IR/MetadataTest.cpp
Modified: llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfoMetadata.h?rev=266512&r1=266511&r2=266512&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfoMetadata.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfoMetadata.h Fri Apr 15 22:23:48 2016
@@ -1875,8 +1875,8 @@ class DILocalVariable : public DIVariabl
unsigned Arg, unsigned Flags, ArrayRef<Metadata *> Ops)
: DIVariable(C, DILocalVariableKind, Storage, Line, Ops), Arg(Arg),
Flags(Flags) {
- assert(Flags < ((1 << 16) - 1) && "DILocalVariable: Flags out of range");
- assert(Arg < ((1 << 16) - 1) && "DILocalVariable: Arg out of range");
+ assert(Flags < (1 << 16) && "DILocalVariable: Flags out of range");
+ assert(Arg < (1 << 16) && "DILocalVariable: Arg out of range");
}
~DILocalVariable() = default;
Modified: llvm/trunk/unittests/IR/MetadataTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/MetadataTest.cpp?rev=266512&r1=266511&r2=266512&view=diff
==============================================================================
--- llvm/trunk/unittests/IR/MetadataTest.cpp (original)
+++ llvm/trunk/unittests/IR/MetadataTest.cpp Fri Apr 15 22:23:48 2016
@@ -1817,6 +1817,7 @@ TEST_F(DILocalVariableTest, get) {
DITypeRef Type = getDerivedType();
unsigned Arg = 6;
unsigned Flags = 7;
+ unsigned NotFlags = (~Flags) & ((1 << 16) - 1);
auto *N =
DILocalVariable::get(Context, Scope, Name, File, Line, Type, Arg, Flags);
@@ -1847,7 +1848,7 @@ TEST_F(DILocalVariableTest, get) {
EXPECT_NE(N, DILocalVariable::get(Context, Scope, Name, File, Line, Type,
Arg + 1, Flags));
EXPECT_NE(N, DILocalVariable::get(Context, Scope, Name, File, Line, Type, Arg,
- ~Flags));
+ NotFlags));
TempDILocalVariable Temp = N->clone();
EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));
More information about the llvm-commits
mailing list