Skip to content

Commit

Permalink
Fixed Compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
pikamonvvs committed Jul 11, 2021
1 parent 84024d1 commit 4e0808d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/llvm/IR/ValueMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ValueMap {
explicit ValueMap(const ExtraData &Data, unsigned NumInitBuckets = 64)
: Map(NumInitBuckets), Data(Data) {}

bool hasMD() const { return MDMap; }
bool hasMD() const { return static_cast<bool>(MDMap); }
MDMapT &MD() {
if (!MDMap)
MDMap.reset(new MDMapT);
Expand Down

1 comment on commit 4e0808d

@pikamonvvs
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear Respectful frasercrmck,

Thanks for your contributing a good example of making own LLVM backend.
While I am building your project with gcc-8 or later, I found a small compile error.
The detail that I faced is the same as following.

It was about not being able to convert unique_ptr to bool type implicitly.
So it was needed to be modified to convert explicitly, which was I did.
As is
bool hasMD() const { return MDMap; }
To be
bool hasMD() const { return static_cast<bool>(MDMap); }
Actually, I have not yet verified if certain side effects exist when using gcc 4.9.

Please sign in to comment.