Page MenuHomePhabricator

Make TargetInfo store an actual DataLayout instead of a string.
ClosedPublic

Authored by jyknight on Feb 11 2016, 6:37 PM.

Details

Summary

Use it to calculate UserLabelPrefix, instead of specifying it (often
incorrectly).

Note that the *actual* user label prefix has always come from the
DataLayout, and is handled within LLVM. The main thing clang's
TargetInfo::UserLabelPrefix did was to set the #define value. Having
these be different from each-other is just silly.

Diff Detail

Repository
rL LLVM

Event Timeline

jyknight updated this revision to Diff 47763.Feb 11 2016, 6:37 PM
jyknight retitled this revision from to Make TargetInfo store an actual DataLayout instead of a string..
jyknight updated this object.
jyknight added a reviewer: echristo.
jyknight added a subscriber: cfe-commits.
yaron.keren added a subscriber: yaron.keren.EditedFeb 11 2016, 7:41 PM

We have tried to keep one copy of DataLayout around
http://reviews.llvm.org/D11103
Can it share the Module->getDataLayout() ?

We have tried to keep one copy of DataLayout around
http://reviews.llvm.org/D11103
Can it share the Module->getDataLayout() ?

We're at the beginning of clang here, before preprocessing. There's no llvm::Module yet, one of those doesn't show up until way later, when the AST is ready, and is going to be turned into IR.

Driveby comment: the changes in unittests look unrelated?

Those changes were necessary due to a name (IIRC it was "Module") existing
in both the clang and llvm namespaces, and after this change, becoming
ambiguous in those files.

Those changes were necessary due to a name (IIRC it was "Module") existing
in both the clang and llvm namespaces, and after this change, becoming
ambiguous in those files.

Ah, that one. Okay.

Ping. I'm pretty sure you said you were going to look at this. :)

echristo accepted this revision.Mar 2 2016, 11:37 AM
echristo edited edge metadata.

Sorry, I've been waffling on this, but I think this is fine.

Thanks!

-eric

This revision is now accepted and ready to land.Mar 2 2016, 11:37 AM

This is awesome!

include/clang/CodeGen/BackendUtil.h
38 ↗(On Diff #47763)

Should TDesc be a reference?

This revision was automatically updated to reflect the committed changes.
jyknight marked an inline comment as done.