[x32] Add __ILP32__ macro for ILP32 platforms
Summary: Add __ILP32__ and _ILP32 macro for corresponding platforms. Cover x86_64-*-*-gnux32 with test. Test Plan: test added Reviewers: chandlerc, atanasyan Subscribers: cfe-commits, dschuff, zinovy.nis Differential Revision: http://reviews.llvm.org/D4473 llvm-svn: 212931
This commit is contained in:
@@ -595,6 +595,12 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
|
||||
Builder.defineMacro("__LP64__");
|
||||
}
|
||||
|
||||
if (TI.getPointerWidth(0) == 32 && TI.getLongWidth() == 32
|
||||
&& TI.getIntWidth() == 32) {
|
||||
Builder.defineMacro("_ILP32");
|
||||
Builder.defineMacro("__ILP32__");
|
||||
}
|
||||
|
||||
// Define type sizing macros based on the target properties.
|
||||
assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far");
|
||||
Builder.defineMacro("__CHAR_BIT__", "8");
|
||||
|
||||
Reference in New Issue
Block a user