This is an archive of the discontinued LLVM Phabricator instance.

Remove llvm::(cast|isa) from lib/CodeGen/Address.h to fix build with gcc-4.8.1
ClosedPublic

Authored by sugak on Feb 2 2016, 12:58 PM.

Details

Reviewers
rjmccall
rsmith
Summary

gcc-4.8.1 fails to build clang because of a regression in that version of gcc
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58022). See details about the
generated error in https://llvm.org/bugs/show_bug.cgi?id=26362. To work around
the build error, this diff moves definitions cast(clang::CodeGen::Address) and
isa(clang::CodeGen::Address) from llvm to clang namespace. No build errors
are introduced with this change.

I've tested this with gcc-4.8.1 and gcc-4.9.0 both on master and release_38.

Diff Detail

Event Timeline

sugak updated this revision to Diff 46690.Feb 2 2016, 12:58 PM
sugak retitled this revision from to Remove llvm::(cast|isa) from lib/CodeGen/Address.h to fix build with gcc-4.8.1.
sugak updated this object.
sugak added reviewers: rsmith, rjmccall.
sugak added subscribers: hans, cfe-commits.
rsmith accepted this revision.Feb 2 2016, 1:29 PM
rsmith edited edge metadata.

Yuck. Yeah, LGTM. Do you need someone to commit this for you?

Hans, this should go into 3.8 as well.

This revision is now accepted and ready to land.Feb 2 2016, 1:29 PM
rjmccall edited edge metadata.Feb 2 2016, 1:37 PM

LGTM, too.

sugak added a comment.Feb 2 2016, 2:06 PM

@rsmith: yes, I need someone to commit this.

rsmith closed this revision.Feb 2 2016, 3:16 PM

Thanks, committed as r259598.