FailedChanges

Summary

  1. [InstCombine] fix matcher to bind to specific operand (PR32830) Matching any random value would be very wrong: https://bugs.llvm.org/show_bug.cgi?id=32830
  2. Headers: Make the type of SIZE_MAX the same as size_t size_t is usually defined as unsigned long, but on 64-bit platforms, stdint.h currently defines SIZE_MAX using "ull" (unsigned long long). Although this is the same width, it doesn't necessarily have the same alignment or calling convention. It also triggers printf warnings when using the format flag "%zu" to print SIZE_MAX. This changes SIZE_MAX to reuse the compiler-provided __SIZE_MAX__, and provides similar fixes for the other integers: - INTPTR_MIN - INTPTR_MAX - UINTPTR_MAX - PTRDIFF_MIN - PTRDIFF_MAX - INTMAX_MIN - INTMAX_MAX - UINTMAX_MAX - INTMAX_C() - UINTMAX_C() ... and fixes the typedefs for intptr_t and uintptr_t to use __INTPTR_TYPE__ and __UINTPTR_TYPE__ instead of int32_t, effectively reverting r89224, r89226, and r89237 (r89221 already having been effectively reverted). We can probably also kill __INTPTR_WIDTH__, __INTMAX_WIDTH__, and __UINTMAX_WIDTH__ in a follow-up, but I was hesitant to delete all the per-target CHECK lines in this commit since those might serve their own purpose. rdar://problem/11811377
  3. Preprocessor: Suppress -Wnonportable-include-path for header maps If a file search involves a header map, suppress -Wnonportable-include-path. It's firing lots of false positives for framework authors internally, and it's not trivial to fix. Consider a framework called "Foo" with a main (installed) framework header "Foo/Foo.h". It's atypical for "Foo.h" to actually live inside a directory called "Foo" in the source repository. Instead, the build system generates a header map while building the framework. If Foo.h lives at the top-level of the source repository (common), and the git repo is called ssh://some.url/foo.git, then the header map will have something like: Foo/Foo.h -> /Users/myname/code/foo/Foo.h where "/Users/myname/code/foo" is the clone of ssh://some.url/foo.git. After #import <Foo/Foo.h>, the current implementation of -Wnonportable-include-path will falsely assume that Foo.h was found in a nonportable way, because of the name of the git clone (.../foo/Foo.h). However, that directory name was not involved in the header search at all. This commit adds an extra parameter to Preprocessor::LookupFile and HeaderSearch::LookupFile to track if the search used a header map, making it easy to suppress the warning. Longer term, once we find a way to avoid the false positive, we should turn the warning back on. rdar://problem/28863903
Revision 301594 by spatel:
[InstCombine] fix matcher to bind to specific operand (PR32830)

Matching any random value would be very wrong:
https://bugs.llvm.org/show_bug.cgi?id=32830
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp (diff)llvm-revision.src/llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
The file was modified/llvm/trunk/test/Transforms/InstCombine/and-or-not.ll (diff)llvm-revision.src/llvm/trunk/test/Transforms/InstCombine/and-or-not.ll
Revision 301593 by Duncan P. N. Exon Smith:
Headers: Make the type of SIZE_MAX the same as size_t

size_t is usually defined as unsigned long, but on 64-bit platforms,
stdint.h currently defines SIZE_MAX using "ull" (unsigned long long).
Although this is the same width, it doesn't necessarily have the same
alignment or calling convention.  It also triggers printf warnings when
using the format flag "%zu" to print SIZE_MAX.

This changes SIZE_MAX to reuse the compiler-provided __SIZE_MAX__, and
provides similar fixes for the other integers:

  - INTPTR_MIN
  - INTPTR_MAX
  - UINTPTR_MAX
  - PTRDIFF_MIN
  - PTRDIFF_MAX
  - INTMAX_MIN
  - INTMAX_MAX
  - UINTMAX_MAX
  - INTMAX_C()
  - UINTMAX_C()

... and fixes the typedefs for intptr_t and uintptr_t to use
__INTPTR_TYPE__ and __UINTPTR_TYPE__ instead of int32_t, effectively
reverting r89224, r89226, and r89237 (r89221 already having been
effectively reverted).

We can probably also kill __INTPTR_WIDTH__, __INTMAX_WIDTH__, and
__UINTMAX_WIDTH__ in a follow-up, but I was hesitant to delete all the
per-target CHECK lines in this commit since those might serve their own
purpose.

rdar://problem/11811377
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/Headers/stdint.h (diff)llvm-revision.src/cfe/trunk/lib/Headers/stdint.h
The file was added/cfe/trunk/test/Headers/stdint-typeof-MINMAX.cppllvm-revision.src/cfe/trunk/test/Headers/stdint-typeof-MINMAX.cpp
The file was modified/cfe/trunk/test/Preprocessor/stdint.c (diff)llvm-revision.src/cfe/trunk/test/Preprocessor/stdint.c
Revision 301592 by Duncan P. N. Exon Smith:
Preprocessor: Suppress -Wnonportable-include-path for header maps

If a file search involves a header map, suppress
-Wnonportable-include-path.  It's firing lots of false positives for
framework authors internally, and it's not trivial to fix.

Consider a framework called "Foo" with a main (installed) framework header
"Foo/Foo.h".  It's atypical for "Foo.h" to actually live inside a
directory called "Foo" in the source repository.  Instead, the
build system generates a header map while building the framework.
If Foo.h lives at the top-level of the source repository (common), and
the git repo is called ssh://some.url/foo.git, then the header map will
have something like:

    Foo/Foo.h -> /Users/myname/code/foo/Foo.h

where "/Users/myname/code/foo" is the clone of ssh://some.url/foo.git.

After #import <Foo/Foo.h>, the current implementation of
-Wnonportable-include-path will falsely assume that Foo.h was found in a
nonportable way, because of the name of the git clone (.../foo/Foo.h).
However, that directory name was not involved in the header search at
all.

This commit adds an extra parameter to Preprocessor::LookupFile and
HeaderSearch::LookupFile to track if the search used a header map,
making it easy to suppress the warning.  Longer term, once we find a way
to avoid the false positive, we should turn the warning back on.

rdar://problem/28863903
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/include/clang/Lex/HeaderSearch.h (diff)llvm-revision.src/cfe/trunk/include/clang/Lex/HeaderSearch.h
The file was modified/cfe/trunk/include/clang/Lex/Preprocessor.h (diff)llvm-revision.src/cfe/trunk/include/clang/Lex/Preprocessor.h
The file was modified/cfe/trunk/lib/Frontend/CompilerInstance.cpp (diff)llvm-revision.src/cfe/trunk/lib/Frontend/CompilerInstance.cpp
The file was modified/cfe/trunk/lib/Frontend/Rewrite/InclusionRewriter.cpp (diff)llvm-revision.src/cfe/trunk/lib/Frontend/Rewrite/InclusionRewriter.cpp
The file was modified/cfe/trunk/lib/Frontend/VerifyDiagnosticConsumer.cpp (diff)llvm-revision.src/cfe/trunk/lib/Frontend/VerifyDiagnosticConsumer.cpp
The file was modified/cfe/trunk/lib/Lex/HeaderSearch.cpp (diff)llvm-revision.src/cfe/trunk/lib/Lex/HeaderSearch.cpp
The file was modified/cfe/trunk/lib/Lex/PPDirectives.cpp (diff)llvm-revision.src/cfe/trunk/lib/Lex/PPDirectives.cpp
The file was modified/cfe/trunk/lib/Lex/PPMacroExpansion.cpp (diff)llvm-revision.src/cfe/trunk/lib/Lex/PPMacroExpansion.cpp
The file was modified/cfe/trunk/lib/Lex/Pragma.cpp (diff)llvm-revision.src/cfe/trunk/lib/Lex/Pragma.cpp
The file was added/cfe/trunk/test/Preprocessor/Inputs/nonportable-hmapsllvm-revision.src/cfe/trunk/test/Preprocessor/Inputs/nonportable-hmaps
The file was added/cfe/trunk/test/Preprocessor/Inputs/nonportable-hmaps/foo.hmapllvm-revision.src/cfe/trunk/test/Preprocessor/Inputs/nonportable-hmaps/foo.hmap
The file was added/cfe/trunk/test/Preprocessor/Inputs/nonportable-hmaps/headersllvm-revision.src/cfe/trunk/test/Preprocessor/Inputs/nonportable-hmaps/headers
The file was added/cfe/trunk/test/Preprocessor/Inputs/nonportable-hmaps/headers/foollvm-revision.src/cfe/trunk/test/Preprocessor/Inputs/nonportable-hmaps/headers/foo
The file was added/cfe/trunk/test/Preprocessor/Inputs/nonportable-hmaps/headers/foo/Foo.hllvm-revision.src/cfe/trunk/test/Preprocessor/Inputs/nonportable-hmaps/headers/foo/Foo.h
The file was added/cfe/trunk/test/Preprocessor/nonportable-include-with-hmap.cllvm-revision.src/cfe/trunk/test/Preprocessor/nonportable-include-with-hmap.c