This is an archive of the discontinued LLVM Phabricator instance.

[Clang][Sema] Capturing section type conflicts on #pragma clang section
ClosedPublic

Authored by pratlucas on Apr 21 2020, 9:41 AM.

Details

Summary

Section names used in clang section pragmas were not validated against
previously defined sections, causing section type conflicts to be
ignored by Sema.

This patch enables Clang to capture these section type conflicts by
using the existing Sema's UnifySection method to validate section names
from clang section pragmas.

Diff Detail

Event Timeline

pratlucas created this revision.Apr 21 2020, 9:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2020, 9:41 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
pratlucas updated this revision to Diff 259039.Apr 21 2020, 9:59 AM

Fixing missing clang-format messages.

rnk accepted this revision.Apr 23 2020, 10:44 AM

Seems reasonable.

clang/test/Sema/pragma-clang-section.c
2

You can use expected-note 2 {{#pragma entered here]} to expect the same diagnostic twice.

This revision is now accepted and ready to land.Apr 23 2020, 10:44 AM
pratlucas updated this revision to Diff 262592.May 7 2020, 3:47 AM

Addressing review comment.

pratlucas marked an inline comment as done.May 7 2020, 3:49 AM
This revision was automatically updated to reflect the committed changes.