In TokenLexer::ExpandFunctionArguments(), CurTok.hasLeadingSpace() is
checked in multiple locations, each time subtly differently. Checking it
early, when the token is seen, and using NextTokGetsSpace exclusively
after that makes the code simpler.
No change in behaviour is intended.
Patch by Harald van Dijk!
llvm-svn: 200788
When a macro expansion does not result in any tokens, and the macro name
is preceded by whitespace, the whitespace should be passed to the first
token that follows the macro expansion. Similarly when a macro expansion
ends with a placemarker token, and that placemarker token is preceded by
whitespace. This worked already for top-level macro expansions, but is
now extended to also work for nested macro expansions.
Patch by Harald van Dijk!
llvm-svn: 200787
When a function-like macro definition ends with one of the macro's
parameters, and the argument is empty, any whitespace before the
parameter name in the macro definition needs to be preserved. Promoting
the existing NextTokGetsSpace to a preserved bit-field and checking it
at the end of the macro expansion allows it to be moved to the first
token following the macro expansion result.
Patch by Harald van Dijk!
llvm-svn: 200786
In x ## y, where x and y are regular tokens, whitespace between x and ##
is ignored, and whitespace between ## and y is also ignored. When either
x or y is a function argument, whitespace was preserved, but it should
not be. This patch removes the checks for whitespace before ## and
before y, and in the special case where x is an empty macro argument and
y is a regular token, actively removes whitespace before y.
One existing test is affected by that change, but as clang's output now
matches the standard's requirements and that of GCC, I've tweaked the
testcase.
Patch by Harald van Dijk!
llvm-svn: 200785
Now that the back-end intrinsics are more regular, there's no need for the
special handling these got in the front-end, so they can be moved to
EmitCommonNeonBuiltinExpr.
llvm-svn: 200769
redeclaration, not just when looking them up for a use -- we need the implicit
declaration to appropriately check various properties of them (notably, whether
they're deleted).
llvm-svn: 200729
llvm::sys::cas_flag is 'long' instead of 'uint32_t' on win32, because
that's what InterlockedIncrement is defined to accept.
I still don't know if we should be calling fprintf from ASTUnit.cpp
behind a getenv check.
llvm-svn: 200718
Summary:
Make objects returned by CreateAnalysisConsumer expose an interface,
that allows providing a custom PathDiagnosticConsumer, so that users can have
raw data in a form easily usable from the code (unlike plist/HTML in a file).
Reviewers: jordan_rose, krememek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2556
llvm-svn: 200710
The LLVM backend now has invariant types on the various crypto-intrinsics,
because in all cases there's only really one interpretation.
llvm-svn: 200707
Some lines intended to be used for testing x86_64 ABI compatibility were
not firing because lines were annotated with the wrong FileCheck prefix:
X64 vs x64
N.B. Changes beyond just changing x64 to X64 were made, presumably
because other parts of the layout engine have changed. I've verified
the changes to make sure that MSVC creates a compatible layout.
llvm-svn: 200670
Ranges before:
void test(void (*)(int), int, float);
~~~~~~~~~~~~~ ~~~~ ~~~~~~
Ranges after:
void test(void (*)(int), int, float);
~~~~~~~~~~~~~ ~~~ ~~~~~
This does not change the actual location of the ParmVarDecl, it still
points to the location where the name would be. PR17970.
llvm-svn: 200640
When building for i386 or x86_64 with IPHONEOS_DEPLOYMENT_TARGET set in the
environment, the toolchain correctly recognizes that the target platform is
the iOS simulator. The code in Darwin::addMinVersionArgs was not updated for
svn 197148, where isTargetIPhoneOS() was widely replaced by isTargetIOSBased().
This is kind of a strange case, though, because we probably ought to be
passing -ios_simulator_version_min to the linker, but according to the FIXME
in the code, we intentionally avoid that unless the -mios-simulator-version-min
option was used. I don't know whether it is safe to change that yet, so
for now, I am just fixing the assertion failure.
llvm-svn: 200618
When a non-trivial parameter is present, clang now gathers up all the
parameters that lack inreg and puts them into a packed struct. MSVC
always aligns each parameter to 4 bytes and no more, so this is a pretty
simple struct to lay out.
On win64, non-trivial records are passed indirectly. Prior to this
change, clang was incorrectly using byval on win64.
I'm able to self-host a working clang with this change and additional
LLVM patches.
Reviewers: rsmith
Differential Revision: http://llvm-reviews.chandlerc.com/D2636
llvm-svn: 200597