diff --git a/clang/include/clang/Basic/LLVM.h b/clang/include/clang/Basic/LLVM.h index 02e42205107110..4ac2d744af3c32 100644 --- a/clang/include/clang/Basic/LLVM.h +++ b/clang/include/clang/Basic/LLVM.h @@ -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. diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index 575d1143caab53..2eaa481cd911e5 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -1913,7 +1913,7 @@ static llvm::CallInst * emitCapturedStmtCall(CodeGenFunction &ParentCGF, EmittedClosureTy Cap, llvm::ArrayRef Args) { // Append the closure context to the argument. - llvm::SmallVector EffectiveArgs; + SmallVector EffectiveArgs; EffectiveArgs.reserve(Args.size() + 1); llvm::append_range(EffectiveArgs, Args); EffectiveArgs.push_back(Cap.second); diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 2606e9f1b1854e..5ddd54cf2bc601 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -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 GeneratedArgs1; + SmallVector 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 GeneratedArgs2; + SmallVector GeneratedArgs2; Generate(RealInvocation, GeneratedArgs2, SA); // Compares two lists of generated arguments.