[NFC] Adjust SmallVector.h header to workaround XL build compiler issue

In order to prevent further building issues related to the usage of SmallVector
in other compilation unit, this patch adjusts the llvm.h header as a workaround
instead.

Besides, this patch reverts previous workarounds:

1. Revert "[NFC] Use llvm::SmallVector to workaround XL compiler problem on AIX"
This reverts commit 561fb7f60a.

2.Revert "[clang][cli] Fix build failure in CompilerInvocation"
This reverts commit 8dc70bdcd0.

Differential Revision: https://reviews.llvm.org/D98552
This commit is contained in:
xling-Liao 2021-03-12 15:19:43 -06:00
parent 70c921267e
commit 0bf2da53c1
3 changed files with 6 additions and 3 deletions

View File

@ -22,6 +22,9 @@
// None.h includes an enumerator that is desired & cannot be forward declared
// without a definition of NoneType.
#include "llvm/ADT/None.h"
// Add this header as a workaround to prevent `too few template arguments for
// class template 'SmallVector'` building error with build compilers like XL.
#include "llvm/ADT/SmallVector.h"
namespace llvm {
// ADT's.

View File

@ -1913,7 +1913,7 @@ static llvm::CallInst *
emitCapturedStmtCall(CodeGenFunction &ParentCGF, EmittedClosureTy Cap,
llvm::ArrayRef<llvm::Value *> Args) {
// Append the closure context to the argument.
llvm::SmallVector<llvm::Value *> EffectiveArgs;
SmallVector<llvm::Value *> EffectiveArgs;
EffectiveArgs.reserve(Args.size() + 1);
llvm::append_range(EffectiveArgs, Args);
EffectiveArgs.push_back(Cap.second);

View File

@ -663,7 +663,7 @@ static bool RoundTrip(ParseFn Parse, GenerateFn Generate,
// Generate arguments from the dummy invocation. If Generate is the
// inverse of Parse, the newly generated arguments must have the same
// semantics as the original.
SmallVector<const char *, 16> GeneratedArgs1;
SmallVector<const char *> GeneratedArgs1;
Generate(DummyInvocation, GeneratedArgs1, SA);
// Run the second parse, now on the generated arguments, and with the real
@ -683,7 +683,7 @@ static bool RoundTrip(ParseFn Parse, GenerateFn Generate,
// Generate arguments again, this time from the options we will end up using
// for the rest of the compilation.
SmallVector<const char *, 16> GeneratedArgs2;
SmallVector<const char *> GeneratedArgs2;
Generate(RealInvocation, GeneratedArgs2, SA);
// Compares two lists of generated arguments.