[PATCH] D15996: Avoid undefined behavior in LinkAllPasses.h
Dimitry Andric via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 13 10:33:38 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL257645: Avoid undefined behavior in LinkAllPasses.h (authored by dim).
Changed prior to commit:
http://reviews.llvm.org/D15996?vs=44682&id=44769#toc
Repository:
rL LLVM
http://reviews.llvm.org/D15996
Files:
llvm/trunk/include/llvm/LinkAllPasses.h
Index: llvm/trunk/include/llvm/LinkAllPasses.h
===================================================================
--- llvm/trunk/include/llvm/LinkAllPasses.h
+++ llvm/trunk/include/llvm/LinkAllPasses.h
@@ -160,9 +160,11 @@
(void) llvm::createPostOrderFunctionAttrsPass();
(void) llvm::createReversePostOrderFunctionAttrsPass();
(void) llvm::createMergeFunctionsPass();
- (void) llvm::createPrintModulePass(*(llvm::raw_ostream*)nullptr);
- (void) llvm::createPrintFunctionPass(*(llvm::raw_ostream*)nullptr);
- (void) llvm::createPrintBasicBlockPass(*(llvm::raw_ostream*)nullptr);
+ std::string buf;
+ llvm::raw_string_ostream os(buf);
+ (void) llvm::createPrintModulePass(os);
+ (void) llvm::createPrintFunctionPass(os);
+ (void) llvm::createPrintBasicBlockPass(os);
(void) llvm::createModuleDebugInfoPrinterPass();
(void) llvm::createPartialInliningPass();
(void) llvm::createLintPass();
@@ -186,10 +188,10 @@
(void)new llvm::IntervalPartition();
(void)new llvm::ScalarEvolutionWrapperPass();
- ((llvm::Function*)nullptr)->viewCFGOnly();
+ llvm::Function::Create(nullptr, llvm::GlobalValue::ExternalLinkage)->viewCFGOnly();
llvm::RGPassManager RGM;
- ((llvm::RegionPass*)nullptr)->runOnRegion((llvm::Region*)nullptr, RGM);
- llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)nullptr);
+ llvm::AliasAnalysis AA;
+ llvm::AliasSetTracker X(AA);
X.add(nullptr, 0, llvm::AAMDNodes()); // for -print-alias-sets
(void) llvm::AreStatisticsEnabled();
(void) llvm::sys::RunningOnValgrind();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15996.44769.patch
Type: text/x-patch
Size: 1635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160113/45776d5a/attachment.bin>
More information about the llvm-commits
mailing list