[cfe-commits] Add cpp frontend
Chris Lattner
clattner at apple.com
Sun Mar 6 10:33:35 PST 2011
On Mar 6, 2011, at 10:24 AM, Douglas Gregor wrote:
>>> +++ tools/driver/driver.cpp (working copy)
>>> @@ -342,6 +342,11 @@
>>> TheDriver.CCCIsCXX = true;
>>> }
>>>
>>> + if (llvm::StringRef(ProgName).endswith("cpp") ||
>>> + llvm::StringRef(ProgName).rsplit('-').first.endswith("cpp")) {
>>> + TheDriver.CCCIsCPP = true;
>>> + }
>
> Why is this an "endswith" check rather than equality comparison? I suspect that we just want to match "cpp" or "cpp-version".
>
> Even as "cpp", we're still going to outright reject "-traditional". Is that still the right thing to do?
>
> Anyway, this looks okay to me, but I'd love to hear Daniel's opinion on this.
My understanding is that cpp also defaults to a mix of traditional mode as well as ISO conformance, though it isn't clear to me looking at the man page.
>From my perspective, this patch looks like a reasonable first start towards clang implementing full /usr/bin/cpp, so I'm ok with it even if it isn't solving all open issues.
-Chris
More information about the cfe-commits
mailing list