This is an archive of the discontinued LLVM Phabricator instance.

[RenderScript] Use LLVM DWARF language enum
ClosedPublic

Authored by EwanCrawford on Feb 1 2016, 3:50 AM.

Details

Summary

A DWARF language vender extension for RenderScript was added to LLVM in r259348(http://reviews.llvm.org/D16409)
We should use this generated enum instead of the hardcoded value.

RenderScript is also C99 with some extensions, so when it's detected we should treat it as C.

Diff Detail

Repository
rL LLVM

Event Timeline

EwanCrawford retitled this revision from to [RenderScript] Use LLVM DWARF language enum.
EwanCrawford updated this object.
EwanCrawford added a reviewer: clayborg.
EwanCrawford set the repository for this revision to rL LLVM.
EwanCrawford added a subscriber: lldb-commits.
clayborg edited edge metadata.Feb 1 2016, 12:03 PM

See inlined comments.

source/Target/Language.cpp
272 ↗(On Diff #46520)

Why is this needed? Seems like this is incorrect. Are you trying to ask if a language uses the clang::ASTContext? Please explain why renderscript is C.

EwanCrawford edited edge metadata.

Thanks for taking a look, yes I want to use ClangASTContext.
Although RenderScript is mostly just C99 checking for it in a function called LanguageIsC does seem off.

I've put the comparison directly in ClangASTContextSupportsLanguage(), but let me know if you'd prefer a more generic solution for allowing new languages to use ClangASTContext.

clayborg accepted this revision.Feb 2 2016, 9:44 AM
clayborg edited edge metadata.

Yes, the fix above in ClangASTContext.cpp was what I was looking for! Looks good.

This revision is now accepted and ready to land.Feb 2 2016, 9:44 AM
This revision was automatically updated to reflect the committed changes.