Commit Graph

6 Commits

Author SHA1 Message Date
Mehdi Amini
c94da20917 Make DataLayout Non-Optional in the Module
Summary:
DataLayout keeps the string used for its creation.

As a side effect it is no longer needed in the Module.
This is "almost" NFC, the string is no longer
canonicalized, you can't rely on two "equals" DataLayout
having the same string returned by getStringRepresentation().

Get rid of DataLayoutPass: the DataLayout is in the Module

The DataLayout is "per-module", let's enforce this by not
duplicating it more than necessary.
One more step toward non-optionality of the DataLayout in the
module.

Make DataLayout Non-Optional in the Module

Module->getDataLayout() will never returns nullptr anymore.

Reviewers: echristo

Subscribers: resistor, llvm-commits, jholewinski

Differential Revision: http://reviews.llvm.org/D7992

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231270 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 18:43:29 +00:00
Rafael Espindola
7e3e9aa8e1 Don't assume an empty stderr.
GuardMalloc can print info to stderr, causing these tests to fail.
Since FileCheck errors on empty inputs, just add a bit of dummy
data to make it happy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203595 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 18:25:33 +00:00
JF Bastien
51da5c7631 Fix datalayout test that I broke with my previous LinkModules warning improvement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203011 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 21:37:08 +00:00
Juergen Ributzka
4fb1463736 Revert "Use count 0."
This reverts commit r202283, because when we use GuardMalloc the test will fail
due to additional output to std err.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202341 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-27 03:10:10 +00:00
Rafael Espindola
a55b3dfdc6 Use count 0.
Thanks to Roman Divacky for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202283 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-26 17:57:35 +00:00
Rafael Espindola
c4bdb93d6a Compare DataLayout by Value, not by pointer.
This fixes spurious warnings in llvm-link about the datalayout not matching.

Thanks to Zalman Stern for reporting the bug!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202276 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-26 17:02:08 +00:00