Skip to content

setting platform-specific PP macros should be exposed as a library method #4351

@llvmbot

Description

@llvmbot
Bugzilla Link 3979
Resolution FIXED
Resolved on Feb 22, 2010 12:49
Version unspecified
OS All
Reporter LLVM Bugzilla Contributor
CC @efriedma-quic

Extended Description

Recently, a change was made to move platform-specific macro setup from the PP to clang-cc.cpp - InitializePredefinedMacros().

While the idea to de-couple it from the PP is nice, this poses a problem for users who are interested in writing tools that use clang as a library.

A tool should be able to initialize the PP with the default macros for his target triple without explicitly setting those macros and knowing about the specific macros. It should just call some library method in clang.

This used to be the case, as it was handled by the PP. However, it is no longer possible - since it is now done in a static method in clang-cc.cpp.

The alternative, to copy-paste a bunch of code that sets specific macros from clang-cc.cpp into one's ow app that uses clang as a library, really sucks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl'

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions