]> granicus.if.org Git - clang/log
clang
10 years agoIn the FreeBSD assembler driver, inform the sparc assembler that we're producing
Roman Divacky [Thu, 2 Jan 2014 15:13:18 +0000 (15:13 +0000)]
In the FreeBSD assembler driver, inform the sparc assembler that we're producing
PIC code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198311 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdded an option to avoid splitting certain kinds of comments into lines.
Alexander Kornienko [Thu, 2 Jan 2014 15:13:14 +0000 (15:13 +0000)]
Added an option to avoid splitting certain kinds of comments into lines.

Summary: Added CommentPragmas option for this.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2460

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198310 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoVerify that clang TargetInfo descriptions match DataLayout strings from LLVM
Alp Toker [Thu, 2 Jan 2014 15:08:04 +0000 (15:08 +0000)]
Verify that clang TargetInfo descriptions match DataLayout strings from LLVM

The backend string is only verified when available as it's possible to run
clang IRGen for targets that haven't been built or don't exist in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198309 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove the now unused 's' specifications.
Rafael Espindola [Thu, 2 Jan 2014 14:06:59 +0000 (14:06 +0000)]
Remove the now unused 's' specifications.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198308 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPass the aapcs and apcs features down to llvm.
Rafael Espindola [Thu, 2 Jan 2014 13:57:18 +0000 (13:57 +0000)]
Pass the aapcs and apcs features down to llvm.

No functionality change, but unblocks asserting that llvm's and clang's
datalayout strings are the same.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198306 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[OpenCL] The kernel attribute can only be used on functions.
Joey Gouly [Thu, 2 Jan 2014 12:04:42 +0000 (12:04 +0000)]
[OpenCL] The kernel attribute can only be used on functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198300 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate the copyright credits -- Happy new year 2014!
NAKAMURA Takumi [Wed, 1 Jan 2014 08:27:31 +0000 (08:27 +0000)]
Update the copyright credits -- Happy new year 2014!

FIXME: Dragonegg may be updated at non-trivial changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198274 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove an unused diag left over from r198046
Alp Toker [Wed, 1 Jan 2014 06:07:48 +0000 (06:07 +0000)]
Remove an unused diag left over from r198046

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198272 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoEliminate UnaryTypeTraitExpr
Alp Toker [Wed, 1 Jan 2014 05:57:51 +0000 (05:57 +0000)]
Eliminate UnaryTypeTraitExpr

Remove UnaryTypeTraitExpr and switch all remaining type trait related handling
over to TypeTraitExpr.

The UTT/BTT/TT enum prefix and evaluation code is retained pending further
cleanup.

This is part of the ongoing work to unify type traits following the removal of
BinaryTypeTraitExpr in r197273.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198271 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoExpectAndConsume: Diagnose errors automatically
Alp Toker [Wed, 1 Jan 2014 03:08:43 +0000 (03:08 +0000)]
ExpectAndConsume: Diagnose errors automatically

 1) Teach ExpectAndConsume() to emit expected and expected-after diagnostics
    using the generic diagnostic descriptions added in r197972, eliminating another
    set of trivial err_expected_* variations while maintaining existing behaviour.

 2) Lift SkipUntil() recovery out of ExpectAndConsume(). The Expect/Consume
    family of functions are primitive parser operations that now have the
    well-defined property of operating on single tokens. Factoring out recovery
    exposes opportunities for more consistent and tailored error recover at the
    call sites instead of just relying on a bottled SkipUntil formula.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198270 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[OpenCL] Produce an error, instead of a warning, for sizeof(void) in OpenCL.
Joey Gouly [Tue, 31 Dec 2013 15:47:49 +0000 (15:47 +0000)]
[OpenCL] Produce an error, instead of a warning, for sizeof(void) in OpenCL.

Patch by joey.gouly@arm.com

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198264 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRecover from errors in enum definition
Serge Pavlov [Tue, 31 Dec 2013 06:26:03 +0000 (06:26 +0000)]
Recover from errors in enum definition

Previously any error in enum definition body stopped parsing it. With this
change parser tries to recover from errors.
The patch fixes PR10982.

Differential Revision: http://llvm-reviews.chandlerc.com/D2018

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198259 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSilence g++ 4.9 build issue
Alp Toker [Tue, 31 Dec 2013 03:16:57 +0000 (03:16 +0000)]
Silence g++ 4.9 build issue

lib/ASTMatchers/ASTMatchFinder.cpp:276:28: error: typedef 'traverse_can_only_be_instantiated_with_base_type' locally defined but not used [-Werror=unused-local-typedefs]
                            traverse_can_only_be_instantiated_with_base_type);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198256 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSwitch over more of the parser to err_expected
Alp Toker [Mon, 30 Dec 2013 23:29:50 +0000 (23:29 +0000)]
Switch over more of the parser to err_expected

Includes a fix for a missing highlight range caused by a ',' typo in the PP
diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198252 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate DataRecursiveASTVisitor so that it visits attributes.
DeLesley Hutchins [Mon, 30 Dec 2013 21:03:02 +0000 (21:03 +0000)]
Update DataRecursiveASTVisitor so that it visits attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198249 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix two typos in comments. No functionality change.
Nick Lewycky [Mon, 30 Dec 2013 20:16:30 +0000 (20:16 +0000)]
Fix two typos in comments. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198243 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove linkage macro from the CXLanguageKind enum
Reid Kleckner [Mon, 30 Dec 2013 17:48:49 +0000 (17:48 +0000)]
Remove linkage macro from the CXLanguageKind enum

Enums don't have linkage, so clang warns when this expands to dllimport.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198227 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate RecursiveASTVisitor so that it visits attributes. This is currently
DeLesley Hutchins [Mon, 30 Dec 2013 17:24:36 +0000 (17:24 +0000)]
Update RecursiveASTVisitor so that it visits attributes.  This is currently
important for thread safety attributes, which contain expressions that were
not being visited, and were thus invisible to various tools.  There are now
Visit*Attr methods that can be overridden for every attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198224 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoChanged the test to avoid EXPECT_EQ(false, ...), which leads to
Alexander Kornienko [Mon, 30 Dec 2013 16:11:28 +0000 (16:11 +0000)]
Changed the test to avoid EXPECT_EQ(false, ...), which leads to
-Wconversion-null warning in GCC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198214 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[CMake][VS][XCode] Restruct the output directory layout more comfortable, ${BINARY_DI...
NAKAMURA Takumi [Mon, 30 Dec 2013 06:48:30 +0000 (06:48 +0000)]
[CMake][VS][XCode] Restruct the output directory layout more comfortable, ${BINARY_DIR}/${BUILD_MODE}/(bin|lib)

We have been seeing nasty directory layout with CMake multiconfig, such as,
  bin/Release/clang.exe
  lib/clang/3.x/...
  lib/Release/clang/3.x/.. (duplicated)

Move the layout similar to autoconf's;
  Release/bin/clang.exe
  Release/lib/clang/3.x/...

Checked on Visual Studio 10. Could you guys please confirm my change on XCode(and other multiconfig builders)?

Note: Don't set variables CMAKE_*_OUTPUT_DIRECTORY any more, or a certain builder, for eaxample, msbuild.exe, would be confused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198205 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPort r198088 (set NO_DEAD_STRIP for clang) from make to cmake.
Nico Weber [Mon, 30 Dec 2013 03:43:30 +0000 (03:43 +0000)]
Port r198088 (set NO_DEAD_STRIP for clang) from make to cmake.

Also stop setting passing -dead_strip explicitly for libclang and instead
rely on this now happening by default. (And make it happen by default for
add_clang_library, which doesn't use the library cmake functions from llvm.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198200 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFor AArch64 Neon, simplify scalar dup by lane0 for fp.
Jiangning Liu [Mon, 30 Dec 2013 02:45:09 +0000 (02:45 +0000)]
For AArch64 Neon, simplify scalar dup by lane0 for fp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198195 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix and reword some typos
Alp Toker [Mon, 30 Dec 2013 02:06:29 +0000 (02:06 +0000)]
Fix and reword some typos

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198191 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCleanup: Switch the preprocessor to err_pp_expected_after
Alp Toker [Mon, 30 Dec 2013 01:59:29 +0000 (01:59 +0000)]
Cleanup: Switch the preprocessor to err_pp_expected_after

This is approaching consistency but the PP and Parse categories they still have
slightly different wording:

def err_pp_expected_after : Error<"missing %1 after %0">;
def err_expected_after   : Error<"expected %1 after %0">;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198189 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't use PrintFunctionNames.exports on Windows.
Nico Weber [Mon, 30 Dec 2013 00:05:56 +0000 (00:05 +0000)]
Don't use PrintFunctionNames.exports on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198187 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix typo in comment.
Nico Weber [Sun, 29 Dec 2013 23:15:01 +0000 (23:15 +0000)]
Fix typo in comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198186 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[cmake] Set in LLVM_EXPORTED_SYMBOL_FILE PrintFunctionNames/CMakeLists.txt.
Nico Weber [Sun, 29 Dec 2013 23:14:26 +0000 (23:14 +0000)]
[cmake] Set in LLVM_EXPORTED_SYMBOL_FILE PrintFunctionNames/CMakeLists.txt.

The corresponding Makefile sets it too. Also tweak add_clang_library to support
LLVM_EXPORTED_SYMBOL_FILE for modules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198185 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse LLVM_EXPORTED_SYMBOL_FILE in libclang's cmake build.
Nico Weber [Sun, 29 Dec 2013 19:31:48 +0000 (19:31 +0000)]
Use LLVM_EXPORTED_SYMBOL_FILE in libclang's cmake build.

Now the exports file should have an effect on non-darwin too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198176 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFixing a compile error that recently started happening for me in MSVC 2013. CFGTermin...
Aaron Ballman [Sun, 29 Dec 2013 18:59:54 +0000 (18:59 +0000)]
Fixing a compile error that recently started happening for me in MSVC 2013. CFGTerminator has an explicit conversion to bool operator that we can make use of instead of using == 0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198175 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoBriefly document diag-build.sh
Alp Toker [Sat, 28 Dec 2013 21:59:11 +0000 (21:59 +0000)]
Briefly document diag-build.sh

It may be a quick and dirty script but it's still useful to have some
indication as to its purpose.

Text taken straight from Jordan's r158682 commit message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198128 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRename isBuiltinCall() to getBuiltinCallee()
Alp Toker [Sat, 28 Dec 2013 21:59:02 +0000 (21:59 +0000)]
Rename isBuiltinCall() to getBuiltinCallee()

This better describes what the function does.

Cleanup only.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198127 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTidy up CGCXXABI creation
Alp Toker [Sat, 28 Dec 2013 21:58:40 +0000 (21:58 +0000)]
Tidy up CGCXXABI creation

'create' functions conventionally return a pointer, not a reference.

Also use an OwningPtr to get replace the delete of a reference member.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198126 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPropagate "-arch x86_64h" setting to the linker. <rdar://problem/15711488>
Bob Wilson [Sat, 28 Dec 2013 05:26:14 +0000 (05:26 +0000)]
Propagate "-arch x86_64h" setting to the linker. <rdar://problem/15711488>

This is a follow-up to r194907, which added a new -arch setting to make it
easier to specify AVX2 targets. The "-arch x86_64h" option needs to be passed
on to the linker, but it was getting canonicalized to x86_64 by the code
in getArchTypeForDarwinArchName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198096 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSilence a dubious GCC warning about a set but unused global. Indeed, the
Chandler Carruth [Sat, 28 Dec 2013 02:50:00 +0000 (02:50 +0000)]
Silence a dubious GCC warning about a set but unused global. Indeed, the
purpose of this global is to be set and not used. =]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198094 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSet NO_DEAD_STRIP for clang after llvm r198087.
Nico Weber [Fri, 27 Dec 2013 22:39:28 +0000 (22:39 +0000)]
Set NO_DEAD_STRIP for clang after llvm r198087.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198088 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove MS header search test inputs to Inputs/
Reid Kleckner [Fri, 27 Dec 2013 20:41:49 +0000 (20:41 +0000)]
Move MS header search test inputs to Inputs/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198086 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReduce indentation of some VFTableBuilder code.
Reid Kleckner [Fri, 27 Dec 2013 20:29:16 +0000 (20:29 +0000)]
Reduce indentation of some VFTableBuilder code.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198085 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSilence compile warning by removing unused SourceMgr member
Will Wilson [Fri, 27 Dec 2013 20:02:27 +0000 (20:02 +0000)]
Silence compile warning by removing unused SourceMgr member

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198083 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoImplement MSVC header search algorithm in MicrosoftMode.
Will Wilson [Fri, 27 Dec 2013 19:46:16 +0000 (19:46 +0000)]
Implement MSVC header search algorithm in MicrosoftMode.
Follows algorithm described here: http://msdn.microsoft.com/en-us/library/36k2cdd4.aspx

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198082 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix incorrect copy-pasted method decl that MSVC allowed.
Reid Kleckner [Fri, 27 Dec 2013 19:45:53 +0000 (19:45 +0000)]
Fix incorrect copy-pasted method decl that MSVC allowed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198081 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[ms-cxxabi] Emit fewer trivial return adjusting thunks
Reid Kleckner [Fri, 27 Dec 2013 19:43:59 +0000 (19:43 +0000)]
[ms-cxxabi] Emit fewer trivial return adjusting thunks

Most importantly, this makes our vtable layout match MSVC's.  Previously
we would emit a return adjusting thunk whenever the return types
differed, even if the adjustment would have been trivial.

MSVC does emit some trivial return adjusting thunks, but only if there
was already an overridden method that required a return adjustment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198080 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoIn an effort to reduce the likelihood of text getting out of sync, reusing the text...
Aaron Ballman [Fri, 27 Dec 2013 19:08:57 +0000 (19:08 +0000)]
In an effort to reduce the likelihood of text getting out of sync, reusing the text from some diagnostics explicitly. No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198078 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemoved a string literal for a diagnostic, and updated the diagnostic to not manually...
Aaron Ballman [Fri, 27 Dec 2013 16:30:46 +0000 (16:30 +0000)]
Removed a string literal for a diagnostic, and updated the diagnostic to not manually quote. No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198076 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoBury leaked pointers in a global array to silence a leak detector in --disable-free...
Kostya Serebryany [Fri, 27 Dec 2013 08:11:08 +0000 (08:11 +0000)]
Bury leaked pointers in a global array to silence a leak detector in --disable-free mode

Summary:
This is an alternative to http://llvm-reviews.chandlerc.com/D2475
suggested by Chandler.

Reviewers: chandlerc, rnk, dblaikie

CC: cfe-commits, earthdok
Differential Revision: http://llvm-reviews.chandlerc.com/D2478

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198073 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Break default arguments less eagerly.
Daniel Jasper [Fri, 27 Dec 2013 06:39:56 +0000 (06:39 +0000)]
clang-format: Break default arguments less eagerly.

Before:
  void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaaaaaa =
                                              1);

After:
  void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      int aaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198070 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoWarn on mismatched parentheses in memcmp and friends.
Nico Weber [Thu, 26 Dec 2013 23:38:39 +0000 (23:38 +0000)]
Warn on mismatched parentheses in memcmp and friends.

Thisadds a new warning that warns on code like this:

  if (memcmp(a, b, sizeof(a) != 0))

The warning looks like:

test4.cc:5:30: warning: size argument in 'memcmp' call is a comparison [-Wmemsize-comparison]
  if (memcmp(a, b, sizeof(a) != 0))
                   ~~~~~~~~~~^~~~
test4.cc:5:7: note: did you mean to compare the result of 'memcmp' instead?
  if (memcmp(a, b, sizeof(a) != 0))
      ^                          ~
                            )
test4.cc:5:20: note: explicitly cast the argument to size_t to silence this warning
  if (memcmp(a, b, sizeof(a) != 0))
                   ^
                   (size_t)(     )
1 warning generated.

This found 2 bugs in chromium and has 0 false positives on both chromium and
llvm.

The idea of triggering this warning on a binop in the size argument is due to
rnk.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198063 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[ms-abi] unix-line endings in lit test, no functional change
Warren Hunt [Thu, 26 Dec 2013 22:10:14 +0000 (22:10 +0000)]
[ms-abi] unix-line endings in lit test, no functional change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198060 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[ms-abi] Fixes improperly sized vfptrs with pragma pack
Warren Hunt [Thu, 26 Dec 2013 22:09:12 +0000 (22:09 +0000)]
[ms-abi] Fixes improperly sized vfptrs with pragma pack

With pragma pack, the layout engine would produce vfptrs that were
packed width rather than pointer width.  This patch addresses the issue
and adds a test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198059 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTeach the diagnostics engine about the Attr type to make reporting on semantic attrib...
Aaron Ballman [Thu, 26 Dec 2013 18:30:57 +0000 (18:30 +0000)]
Teach the diagnostics engine about the Attr type to make reporting on semantic attributes easier (and not require hard-coded strings). This requires a getSpelling() function on the Attr class, which is table-driven. Updates a handful of cases where a hard-coded string was being used to test the functionality out. Updating associated test cases for the improved quoting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198055 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemoved a string literal for an attribute name, which means the attribute name will...
Aaron Ballman [Thu, 26 Dec 2013 17:30:44 +0000 (17:30 +0000)]
Removed a string literal for an attribute name, which means the attribute name will be quoted in the diagnostic. Manually added some quotes to a diagnostic for consistency. Updated the test cases as appropriate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198054 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThis diagnostic did not accept arguments, and did not have any test coverage. Paramet...
Aaron Ballman [Thu, 26 Dec 2013 17:07:49 +0000 (17:07 +0000)]
This diagnostic did not accept arguments, and did not have any test coverage. Parameterized the diagnostic, and made it more consistent with other attribute diagnostic wordings. Added test coverage.

Since this warning was generalized, it was also given a sensible warning group flag and the corresponding test was updated to reflect this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198053 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agos/getter_setter/accessor No functional changes intended.
Aaron Ballman [Thu, 26 Dec 2013 16:35:04 +0000 (16:35 +0000)]
s/getter_setter/accessor No functional changes intended.

Thanks to Alp Toker for the naming suggestion!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198052 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSimplifying some diagnostics so that they don't need to work with StringRefs. No...
Aaron Ballman [Thu, 26 Dec 2013 16:30:30 +0000 (16:30 +0000)]
Simplifying some diagnostics so that they don't need to work with StringRefs. No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198051 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoGetting rid of a string literal in favor of the generalized diagnostic.
Aaron Ballman [Thu, 26 Dec 2013 16:13:50 +0000 (16:13 +0000)]
Getting rid of a string literal in favor of the generalized diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198050 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoParameterizing some MS property-related diagnostics. No functional changes intended.
Aaron Ballman [Thu, 26 Dec 2013 15:46:38 +0000 (15:46 +0000)]
Parameterizing some MS property-related diagnostics. No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198049 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoNo need for the manual quotes and extra getName() call. No functional changes intended.
Aaron Ballman [Thu, 26 Dec 2013 15:06:01 +0000 (15:06 +0000)]
No need for the manual quotes and extra getName() call. No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198047 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemoving some unneeded code, and a diagnostic that was obsoleted. The type has alread...
Aaron Ballman [Thu, 26 Dec 2013 14:54:11 +0000 (14:54 +0000)]
Removing some unneeded code, and a diagnostic that was obsoleted. The type has already been determined to be a ValueDecl by virtue of the attribute subjects.

Added some test case coverage as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198046 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't reserve __builtin_types_compatible_p as a C++ keyword
Alp Toker [Wed, 25 Dec 2013 01:47:02 +0000 (01:47 +0000)]
Don't reserve __builtin_types_compatible_p as a C++ keyword

Even g++ considers this a valid C++ identifier and it should only have been
visible in C mode.

Also drop the associated low-value diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197995 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd some missing test cases for ACLE intrinsics of AArch64 NEON.
Jiangning Liu [Wed, 25 Dec 2013 01:23:43 +0000 (01:23 +0000)]
Add some missing test cases for ACLE intrinsics of AArch64 NEON.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197994 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd a FIXME to a failing test.
Nico Weber [Tue, 24 Dec 2013 20:48:13 +0000 (20:48 +0000)]
Add a FIXME to a failing test.

(See discussion in the bug for why this isn't XFAILed.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197991 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: (WebKit) Disallow 1-line constructors with initializers.
Daniel Jasper [Tue, 24 Dec 2013 13:31:25 +0000 (13:31 +0000)]
clang-format: (WebKit) Disallow 1-line constructors with initializers.

Before:
  Constructor() : a(a) {}

After:
  Constructor()
      : a(a)
  {
  }

This style guide is pretty precise about this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197980 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSupport and use token kinds as diagnostic arguments
Alp Toker [Tue, 24 Dec 2013 09:48:30 +0000 (09:48 +0000)]
Support and use token kinds as diagnostic arguments

Introduce proper facilities to render token spellings using the diagnostic
formatter.

Replaces most of the hard-coded diagnostic messages related to expected tokens,
which all shared the same semantics but had to be multiply defined due to
variations in token order or quote marks.

The associated parser changes are largely mechanical but they expose
commonality in whole chunks of the parser that can now be factored away.

This commit uses C++11 typed enums along with a speculative legacy fallback
until the transition is complete.

Requires corresponding changes in LLVM r197895.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197972 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDocument the Message parameter of getCustomDiagID()
Alp Toker [Mon, 23 Dec 2013 21:00:35 +0000 (21:00 +0000)]
Document the Message parameter of getCustomDiagID()

A lot of callers have been using this facility incorrectly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197920 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoremove dead code.
Adrian Prantl [Mon, 23 Dec 2013 19:10:57 +0000 (19:10 +0000)]
remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197916 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix another misuse of getCustomDiagID()
Alp Toker [Mon, 23 Dec 2013 17:59:59 +0000 (17:59 +0000)]
Fix another misuse of getCustomDiagID()

There's no need to escape strings and generate new DiagIDs for each message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197915 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang/Analysis/FlowSensitive/DataflowSolver.h: <functional> should be just a STL...
NAKAMURA Takumi [Mon, 23 Dec 2013 16:34:51 +0000 (16:34 +0000)]
clang/Analysis/FlowSensitive/DataflowSolver.h: <functional> should be just a STL header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197912 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoConsolidating some mode attribute diagnostics. No functional changes intended.
Aaron Ballman [Mon, 23 Dec 2013 15:23:11 +0000 (15:23 +0000)]
Consolidating some mode attribute diagnostics. No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197911 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Fix invalid write discovered by ASAN.
Daniel Jasper [Mon, 23 Dec 2013 11:25:40 +0000 (11:25 +0000)]
clang-format: Fix invalid write discovered by ASAN.

Introduced in r197900.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197906 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd a missing pipe in the test from r197896
Alp Toker [Mon, 23 Dec 2013 08:50:43 +0000 (08:50 +0000)]
Add a missing pipe in the test from r197896

Spotted by Edward

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197903 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTextDiagnosticBuffer: Fix copy-paste mistake in r197856
Alp Toker [Mon, 23 Dec 2013 07:47:48 +0000 (07:47 +0000)]
TextDiagnosticBuffer: Fix copy-paste mistake in r197856

The TextDiagnosticBuffer is meant to scrub SourceLocations as the input/output
SourceManagers may be different.

To be safe this commit restores the original behaviour though in practice
all current users seem to share a single SM.

Would be nice to replace TextDiagnosticBuffer now that more capable interfaces
like CaptureDiagnosticConsumer / StoredDiagnosticConsumer exist.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197902 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Fix various problems in formatting ObjC blocks.
Daniel Jasper [Mon, 23 Dec 2013 07:29:06 +0000 (07:29 +0000)]
clang-format: Fix various problems in formatting ObjC blocks.

Among other things, this fixes llvm.org/PR15269.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197900 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[AArch64]The compare to zero intrinsics should be implemented by 'icmp/fcmp' and...
Hao Liu [Mon, 23 Dec 2013 02:44:00 +0000 (02:44 +0000)]
[AArch64]The compare to zero intrinsics should be implemented by 'icmp/fcmp' and 'sext' not 'zext'. Modify the implementation by replacing zext with sext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197898 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMake some f_Group definitions anonymous and test an alternative spelling
Alp Toker [Sun, 22 Dec 2013 22:38:57 +0000 (22:38 +0000)]
Make some f_Group definitions anonymous and test an alternative spelling

These names weren't referred to anywhere in the source so don't need a written
name.

Depends on the TableGen fix for anonymous records in LLVM r197869.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197896 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemoving the alloc_size attribute. The attribute was semantically handled, but silent...
Aaron Ballman [Sat, 21 Dec 2013 17:15:13 +0000 (17:15 +0000)]
Removing the alloc_size attribute. The attribute was semantically handled, but silently ignored. Most of this feature was already reverted in June 2012 (r159016), this just cleans up the pieces left over.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197866 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThe const and nothrow attributes can be handled by the simple attribute handler....
Aaron Ballman [Sat, 21 Dec 2013 16:49:29 +0000 (16:49 +0000)]
The const and nothrow attributes can be handled by the simple attribute handler. This removes a silent dropping of the attributes when they are duplicated on a Decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197864 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix getCustomDiagID() usage in CodeGen and TextDiagnosticBuffer
Alp Toker [Sat, 21 Dec 2013 05:20:03 +0000 (05:20 +0000)]
Fix getCustomDiagID() usage in CodeGen and TextDiagnosticBuffer

DiagIDs are a cached resource generally only constructed from compile-time
constant or stable format strings.

Escaping arbitrary messages and constructing DiagIDs from them didn't make
sense.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197856 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix getCustomDiagID() usage in example code
Alp Toker [Sat, 21 Dec 2013 05:19:58 +0000 (05:19 +0000)]
Fix getCustomDiagID() usage in example code

This was setting a bad example. DiagIDs are a limited resource and the message
argument is evaluated as a format string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197855 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd -Winfinite-recursion to Clang
Richard Trieu [Sat, 21 Dec 2013 02:33:43 +0000 (02:33 +0000)]
Add -Winfinite-recursion to Clang

This new warning detects when a function will recursively call itself on every
code path though that function.  This catches simple recursive cases such as:

void foo() {
  foo();
}

As well as more complex functions like:

void bar() {
  if (test()) {
    bar();
    return;
  } else {
    bar();
  }
  return;
}

This warning uses the CFG.  As with other CFG-based warnings, this is off
by default.  Due to false positives, this warning is also disabled for
templated functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197853 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[CMake] clang/lib/Headers: Install just-generated ${CMAKE_CURRENT_BINARY_DIR}/arm_neo...
NAKAMURA Takumi [Sat, 21 Dec 2013 01:56:00 +0000 (01:56 +0000)]
[CMake] clang/lib/Headers: Install just-generated ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h, instead of copied arm_neon.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197852 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAssert that tag decls are never marked (in)valid after definition is complete
Alp Toker [Sat, 21 Dec 2013 01:10:54 +0000 (01:10 +0000)]
Assert that tag decls are never marked (in)valid after definition is complete

Sema relies on this assumption.

Follow-up to r197848.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197850 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse this one little trick to prevent optimizers from removing an
Richard Trieu [Sat, 21 Dec 2013 01:04:02 +0000 (01:04 +0000)]
Use this one little trick to prevent optimizers from removing an
intentional stack overflow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197849 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't mark record decls invalid when one of its methods is invalid, PR18284.
Nico Weber [Sat, 21 Dec 2013 00:49:51 +0000 (00:49 +0000)]
Don't mark record decls invalid when one of its methods is invalid, PR18284.

Without this patch, record decls with invalid out-of-line method delcs would
sometimes be marked invalid, but not always.  With this patch, they are
consistently never marked invalid.

(The code to do this was added in
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100809/033154.html
, but the test from that revision is still passing.)

As far as I can tell, this was the only place where a class was marked invalid
after its definition was complete.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197848 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoEliminate the ItaniumVTableContext object from CodeGenVTables
Reid Kleckner [Fri, 20 Dec 2013 23:58:52 +0000 (23:58 +0000)]
Eliminate the ItaniumVTableContext object from CodeGenVTables

Now CodeGenVTables has only one VTableContext object, which is either
Itanium or Microsoft.

Fixes a FIXME with no functionality change intended.

Ideally we could avoid the downcasts by pushing the things that
reference the Itanium vtable context into ItaniumCXXABI.cpp, but we're
not there yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197845 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDebugInfo: Do not include implicit members (implicit special members, template instan...
David Blaikie [Fri, 20 Dec 2013 23:19:47 +0000 (23:19 +0000)]
DebugInfo: Do not include implicit members (implicit special members, template instantiations, etc) in the list of members of a structure.

These members will still be lazily added to the relevant DWARF DIEs in
LLVM but when enumerating the members they will not appear. This allows
DWARF type units to be more consistent - the type unit will never
contain these special members (so all instances of the type should have
the same DIEs without some having some special members and others having
others) and the special members will be added to the skeletal
declaration that appears in the relevant compile_unit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197844 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove obsolete preamble FIXME
Alp Toker [Fri, 20 Dec 2013 22:27:20 +0000 (22:27 +0000)]
Remove obsolete preamble FIXME

The MD5 is checked since r197755 which is as good as comparing buffer contents
in this context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197842 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoOverride the datalayout in a module with -triple.
Rafael Espindola [Fri, 20 Dec 2013 22:01:25 +0000 (22:01 +0000)]
Override the datalayout in a module with -triple.

This matches llc's behavior.

Before this patch clang would create a TargetInfo base on -triple but a llvm
CodeGen based on the triple in the module.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197837 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCompare canonical return types when generating MS C++ ABI vtable thunks
Reid Kleckner [Fri, 20 Dec 2013 21:44:05 +0000 (21:44 +0000)]
Compare canonical return types when generating MS C++ ABI vtable thunks

This was part of the cause for PR17655.  We were generating thunks when
we shouldn't have.  I suspect that if we tweak the test case for PR17655
to actually require thunks, we can reproduce the same crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197836 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove the TargetMachine instance into EmitAssemblyHelper
Alp Toker [Fri, 20 Dec 2013 20:26:53 +0000 (20:26 +0000)]
Move the TargetMachine instance into EmitAssemblyHelper

Cleanup in preparation for enhanced DataLayout checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197832 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-cl: Support /P and /E (preprocess to file or stdout)
Hans Wennborg [Fri, 20 Dec 2013 18:40:46 +0000 (18:40 +0000)]
clang-cl: Support /P and /E (preprocess to file or stdout)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197827 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove an outdated statement about debugging optimized code.
Adrian Prantl [Fri, 20 Dec 2013 17:39:42 +0000 (17:39 +0000)]
Remove an outdated statement about debugging optimized code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197820 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDocument the -fno-limit-debug-info switch in the man page.
Adrian Prantl [Fri, 20 Dec 2013 17:39:35 +0000 (17:39 +0000)]
Document the -fno-limit-debug-info switch in the man page.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197819 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoEnable layering check in unavailable modules.
Daniel Jasper [Fri, 20 Dec 2013 12:09:36 +0000 (12:09 +0000)]
Enable layering check in unavailable modules.

If a header file belonging to a certain module is not found on the
filesystem, that header gets marked as unavailable. Now, the layering
warning (-fmodules-decluse) should still warn about headers of this
module being wrongfully included. Currently, headers belonging to those
modules are just treated as not belonging to modules at all which means
they can be included freely from everywhere.

To implement this (somewhat) cleanly, I have moved most of the layering
checks into the ModuleMap. This will also help with showing FixIts
later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197805 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Better support for multi-line wide string literals.
Daniel Jasper [Fri, 20 Dec 2013 06:22:01 +0000 (06:22 +0000)]
clang-format: Better support for multi-line wide string literals.

Before:
  SomeFunction(L"A" L"B");

After:
  SomeFunction(L"A"
               L"B");

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197785 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[analyzer] Use DataRecursiveASTVisitor for the AnalysisConsumer.
Argyrios Kyrtzidis [Fri, 20 Dec 2013 02:02:58 +0000 (02:02 +0000)]
[analyzer] Use DataRecursiveASTVisitor for the AnalysisConsumer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197767 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove tools/libclang/RecursiveASTVisitor.h -> include/clang/AST/DataRecursiveASTVisitor.h
Argyrios Kyrtzidis [Fri, 20 Dec 2013 02:02:54 +0000 (02:02 +0000)]
Move tools/libclang/RecursiveASTVisitor.h -> include/clang/AST/DataRecursiveASTVisitor.h

This is to make it available so the static analyzer can use it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197766 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[libclang/python] Add CompilationDatabase.getAllCompileCommands to the python bindings.
Argyrios Kyrtzidis [Fri, 20 Dec 2013 01:34:00 +0000 (01:34 +0000)]
[libclang/python] Add CompilationDatabase.getAllCompileCommands to the python bindings.

Patch by Laszlo Nagy!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197765 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSerialize source range info for TypeTraitExpr.
Jordan Rose [Fri, 20 Dec 2013 01:26:47 +0000 (01:26 +0000)]
Serialize source range info for TypeTraitExpr.

This caused some crazy crashes involving std::unordered_map being
deserialized from a PCH file and then template instantiation requiring
an explicit instantiation location; unfortunately I don't really know
how to come up with a minimal test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197764 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCorrectly compute the size in bytes of PreambleFileHash.MD5
Dmitri Gribenko [Fri, 20 Dec 2013 01:07:30 +0000 (01:07 +0000)]
Correctly compute the size in bytes of PreambleFileHash.MD5

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197762 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd a test I forgot to svn add in r197755
Dmitri Gribenko [Fri, 20 Dec 2013 00:21:47 +0000 (00:21 +0000)]
Add a test I forgot to svn add in r197755

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197756 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoASTUnit::getMainBufferWithPrecompiledPreamble: use MD5 hash of the remapped
Dmitri Gribenko [Fri, 20 Dec 2013 00:16:25 +0000 (00:16 +0000)]
ASTUnit::getMainBufferWithPrecompiledPreamble: use MD5 hash of the remapped
files to tell if they were changed since the last time we have computed the
preamble

We used to check only the buffer size, so if the new remapped buffer has the
same size as the previous one, we would think that the buffer did not change,
and we did not rebuild the preambule, which sometimes caused us to crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197755 91177308-0d34-0410-b5e6-96231b3b80d8